Skip to content

Commit 5831169

Browse files
committed
chore(model): Use checkNotNull instead of suppressing unsafe calls
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 63e4481 commit 5831169

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

model/src/main/kotlin/ScannerRun.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ data class ScannerRun(
241241
}
242242
}
243243

244-
@Suppress("UnsafeCallOnNullableType")
245-
val packageProvenance = resolutionResult.packageProvenance!!
244+
val packageProvenance = checkNotNull(resolutionResult.packageProvenance)
246245

247246
val scanResultsByPath = resolutionResult.getKnownProvenancesWithoutVcsPath().mapValues { (_, provenance) ->
248247
scanResultsByProvenance[provenance].orEmpty()
@@ -265,8 +264,7 @@ data class ScannerRun(
265264
it.packageProvenanceResolutionIssue == null && it.nestedProvenanceResolutionIssue == null
266265
} ?: return null
267266

268-
@Suppress("UnsafeCallOnNullableType")
269-
val packageProvenance = resolutionResult.packageProvenance!!
267+
val packageProvenance = checkNotNull(resolutionResult.packageProvenance)
270268

271269
val fileListsByPath = resolutionResult.getKnownProvenancesWithoutVcsPath().mapValues { (_, provenance) ->
272270
// If there was an issue creating at least one file list, then return null instead of an incomplete file

0 commit comments

Comments
 (0)