From 9f49b605d9f69684212c173fb04d218aede18b00 Mon Sep 17 00:00:00 2001 From: LeafHacker Date: Sun, 16 Aug 2020 15:43:46 +0100 Subject: [PATCH] Set the version to "dev build" when null or empty --- .../io/github/ImpactDevelopment/installer/Installer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/ImpactDevelopment/installer/Installer.java b/src/main/java/io/github/ImpactDevelopment/installer/Installer.java index b0af154..ef93245 100644 --- a/src/main/java/io/github/ImpactDevelopment/installer/Installer.java +++ b/src/main/java/io/github/ImpactDevelopment/installer/Installer.java @@ -23,6 +23,7 @@ package io.github.ImpactDevelopment.installer; import com.beust.jcommander.JCommander; +import com.beust.jcommander.Strings; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import io.github.ImpactDevelopment.installer.gui.AppIcon; @@ -138,7 +139,11 @@ private static String getFilename() { } public static String getVersion() { - return args.getClass().getPackage().getImplementationVersion(); + String version = args.getClass().getPackage().getImplementationVersion(); + if (Strings.isStringEmpty(version)) { + return "dev build"; + } + return version; } public static String getTitle() {