mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Kotlin: Exclude Kotlin files altogether from NullMaybe query
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user