Skip to content

Commit 964d90e

Browse files
committed
Only depend on assemble task if it exists
Use `findByName` instead of `named` to avoid throwing an exception on an unknwon object`
1 parent 68da98d commit 964d90e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/groovy/net/minecraftforge/gradleutils/changelog/ChangelogUtils.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class ChangelogUtils {
4040
action.execute task
4141

4242
project.afterEvaluate {
43-
project.tasks.named(LifecycleBasePlugin.ASSEMBLE_TASK_NAME).configure { it.dependsOn(task) }
43+
//noinspection ConfigurationAvoidance -- we are in afterEvaluate
44+
project.tasks.findByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME)?.configure { Task assemble -> assemble.dependsOn(task) }
4445
}
4546
}
4647
}

0 commit comments

Comments
 (0)