server

Clone or download

Refactored build-date

Modified Files

--- 'a/src/main/java/com/stream_pi/server/window/settings/About/About.java'
+++ b/src/main/java/com/stream_pi/server/window/settings/About/About.java
@@ -16,6 +16,7 @@ import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
@@ -111,13 +112,17 @@ public class About extends VBox
getChildren().addAll(appIconImageView, tabPane, donateButton, hBox, hBox2);
- try
+ InputStream inputStream = Main.class.getResourceAsStream("build-date");
+ if(inputStream != null)
{
- buildDateLabel.setText("Build date/time: " + new String(Objects.requireNonNull(Main.class.getResourceAsStream("build-date")).readAllBytes()));
- }
- catch (Exception e)
- {
- e.printStackTrace();
+ try
+ {
+ buildDateLabel.setText("Build date/time: " + new String(inputStream.readAllBytes()));
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
}
}