Kotlin: Exclude Kotlin files altogether from NullMaybe query

This commit is contained in:
Tamas Vajk
2022-05-16 10:52:20 +02:00
parent c2a8965c90
commit 47ec38c35a

View File

@@ -22,7 +22,7 @@ where
nullDeref(var, access, msg, reason) and
// Exclude definite nulls here, as these are covered by `NullAlways.ql`.
not alwaysNullDeref(var, access) and
// Exclude operands of `!!` in Kotlin, as `!!` means explicit opt out by the user.
not access.getParent() instanceof NotNullExpr
// Kotlin enforces this already:
not access.getLocation().getFile().isKotlinSourceFile()
select access, "Variable $@ may be null here " + msg + ".", var.getVariable(),
var.getVariable().getName(), reason, "this"