Skip to content

Commit

Permalink
hopefully fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Minecraftschurli committed Feb 14, 2024
1 parent c472667 commit 52fbac5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
}

group = "com.github.minecraftschurlimods"
version = "1.0"
version = "1.1"
base.archivesName = "HelperPlugin"

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package com.github.minecraftschurlimods.helperplugin

import net.neoforged.gradle.util.TransformerUtils
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.the

// TODO: remove this once https://github.com/gradle/gradle/issues/23572 is fixed
fun Project.localGradleProperty(name: Provider<String>): Provider<String> = name.map {
if (hasProperty(it))
property(it)?.toString()!!
else
null!!
}
fun Project.localGradleProperty(name: Provider<String>): Provider<String> = name.map(TransformerUtils.guard {
return@guard if (hasProperty(it)) property(it)?.toString() else null
})

fun Project.localGradleProperty(name: String): Provider<String> = localGradleProperty(provider { name })

Expand Down

0 comments on commit 52fbac5

Please sign in to comment.