Skip to content

Commit 47ec38c

Browse files
committed
Kotlin: Exclude Kotlin files altogether from NullMaybe query
1 parent c2a8965 commit 47ec38c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/src/Likely Bugs/Nullness/NullMaybe.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ where
2222
nullDeref(var, access, msg, reason) and
2323
// Exclude definite nulls here, as these are covered by `NullAlways.ql`.
2424
not alwaysNullDeref(var, access) and
25-
// Exclude operands of `!!` in Kotlin, as `!!` means explicit opt out by the user.
26-
not access.getParent() instanceof NotNullExpr
25+
// Kotlin enforces this already:
26+
not access.getLocation().getFile().isKotlinSourceFile()
2727
select access, "Variable $@ may be null here " + msg + ".", var.getVariable(),
2828
var.getVariable().getName(), reason, "this"

0 commit comments

Comments
 (0)