From 9bcd62937d566866d90f0199531ac9eb3fc5652f Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sun, 27 Feb 2022 22:49:27 -0600 Subject: [PATCH] Handle null better --- core/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index b163d3794..e14d69711 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -81,10 +81,10 @@ configure { val indra = the() val mainFile = "src/main/java/org/geysermc/geyser/GeyserImpl.java" - val gitVersion = "git-${indra.branchName()}-${indra.commit()?.name?.substring(0, 7)}" + val gitVersion = "git-${indra.branchName() ?: "DEV"}-${indra.commit()?.name?.substring(0, 7) ?: "0000000"}" replaceToken("\${version}", "${project.version} ($gitVersion)", mainFile) replaceToken("\${gitVersion}", gitVersion, mainFile) replaceToken("\${buildNumber}", Integer.parseInt(System.getProperty("BUILD_NUMBER", "-1")), mainFile) - replaceToken("\${branch}", indra.branchName(), mainFile) + replaceToken("\${branch}", indra.branchName() ?: "DEV", mainFile) } \ No newline at end of file