Skip to content

Commit 3d9c0cb

Browse files
committed
C#: Take null conditional assignments into account in MaybeNullExpr.
1 parent f0d70f3 commit 3d9c0cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ private Expr maybeNullExpr(Expr reason) {
4343
)
4444
or
4545
result.(NullCoalescingExpr).getRightOperand() = maybeNullExpr(reason)
46+
or
47+
result =
48+
any(QualifiableExpr qe |
49+
qe.isConditional() and
50+
qe.getQualifier() = maybeNullExpr(reason)
51+
)
4652
}
4753

4854
/** An expression that may be `null`. */

0 commit comments

Comments
 (0)