Skip to content

Commit b974426

Browse files
committed
Verify parent path is not-null
As a result of the new nullability annotations used in Gradle 9.0.0 an explicit non-null check is now required here.
1 parent 6d923bc commit b974426

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

buildSrc/src/main/kotlin/ApplyArgbash.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ abstract class ApplyArgbash @Inject constructor(
4242
fun applyArgbash() {
4343
val argbash = argbashHome.get().file("bin/argbash").asFile
4444
scriptTemplates.get().visit {
45-
if(!isDirectory) {
46-
val relPath = relativePath.parent.pathString
45+
val relativePath = relativePath.parent?.pathString
46+
if (!isDirectory && relativePath != null) {
4747
val basename = file.nameWithoutExtension
48-
val outputFile = outputDir.get().file("$relPath/$basename.sh").asFile
48+
val outputFile = outputDir.get().file("$relativePath/$basename.sh").asFile
4949
outputFile.parentFile.mkdirs()
5050

5151
logger.info("Applying argbash to $file")

0 commit comments

Comments
 (0)