Fix null display when no version history

Should've been null checked since I made it nullable. String concat
saved us any real damage and so all we saw was "null" shown to users.
Quick check and now we don't.
This commit is contained in:
Zach Brown 2019-05-30 18:31:48 -05:00
parent f501069d24
commit 0e9230e80c

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add version history to version command
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index ded51d042..e0bd79f60 100644
index ded51d042..513cddb9b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -0,0 +0,0 @@ public class PaperVersionFetcher implements VersionFetcher {
@ -14,8 +14,9 @@ index ded51d042..e0bd79f60 100644
String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]");
- return getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]);
+ String updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]);
+ String history = getHistory();
+
+ return getHistory() + "\n" + updateMessage;
+ return history != null ? history + "\n" + updateMessage : updateMessage;
}
private static @Nullable String getMinecraftVersion() {