Skip to content

Commit dd41f50

Browse files
committed
Fix uses of ConditionBlock that require a condition expression (not a switch case statement)
1 parent 68fe7ef commit dd41f50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/lib/semmle/code/java/dataflow/Nullness.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ private predicate interestingCond(SsaSourceVariable npecand, ConditionBlock cond
460460
varMaybeNullInBlock(_, npecand, cond, _) or
461461
varConditionallyNull(npecand.getAnSsaVariable(), cond, _)
462462
) and
463-
not cond.getCondition().getAChildExpr*() = npecand.getAnAccess()
463+
not cond.getCondition().(Expr).getAChildExpr*() = npecand.getAnAccess()
464464
}
465465

466466
/** A pair of correlated conditions for a given NPE candidate. */
@@ -588,7 +588,7 @@ private predicate trackingVar(
588588
exists(ConditionBlock cond |
589589
interestingCond(npecand, cond) and
590590
varMaybeNullInBlock(_, npecand, cond, _) and
591-
cond.getCondition().getAChildExpr*() = trackvar.getAnAccess() and
591+
cond.getCondition().(Expr).getAChildExpr*() = trackvar.getAnAccess() and
592592
trackssa.getSourceVariable() = trackvar and
593593
trackssa.getDefiningExpr().(VariableAssign).getSource() = init
594594
|

0 commit comments

Comments
 (0)