File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
paperweight-lib/src/main/kotlin/io/papermc/paperweight/util Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -379,12 +379,13 @@ fun ByteArray.asHexString(): String {
379379}
380380
381381fun JavaToolchainService.defaultJavaLauncher (project : Project ): Provider <JavaLauncher > {
382- return launcherFor(project.extensions.getByType<JavaPluginExtension >().toolchain).orElse(
383- launcherFor {
384- // If the java plugin isn't applied, or no toolchain value was set
385- languageVersion.set(JavaLanguageVersion .of(21 ))
386- }
387- )
382+ // If the java plugin isn't applied, or no toolchain value was set
383+ val fallback = launcherFor {
384+ languageVersion.set(JavaLanguageVersion .of(21 ))
385+ }
386+
387+ val ext = project.extensions.findByType<JavaPluginExtension >() ? : return fallback
388+ return launcherFor(ext.toolchain).orElse(fallback)
388389}
389390
390391fun <P : Property <* >> P.withDisallowChanges (): P = apply { disallowChanges() }
You can’t perform that action at this time.
0 commit comments