diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java index e5dd49e14cc..7a6183feec6 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java @@ -1272,7 +1272,8 @@ public void resolve(BlockScope upperScope) { patternVariables = LocalVariableBinding.merge(patternVariables, statement.bindingsWhenComplete()); } } - if ((expressionType.id == TypeIds.T_boolean || expressionType.id == TypeIds.T_JavaLangBoolean) + if (expressionType != null + && (expressionType.id == TypeIds.T_boolean || expressionType.id == TypeIds.T_JavaLangBoolean) && defaultFound && isExhaustive()) { upperScope.problemReporter().caseDefaultPlusTrueAndFalse(this); }