Fix compile issue with commit timestamp

This commit is contained in:
Melledy
2023-12-16 21:38:54 -08:00
parent 82ed8904d6
commit f659662c70
2 changed files with 5 additions and 3 deletions

View File

@@ -229,7 +229,9 @@ public class LunarCore {
builder.append(hash);
long timestamp = buildConfig.getField("COMMIT_TIMESTAMP").getLong(null);
builder.append(" (" + sf.format(new Date(timestamp * 1000)) + ")");
if (timestamp > 0) {
builder.append(" (" + sf.format(new Date(timestamp * 1000)) + ")");
}
} catch (Exception e) {
// Ignored
}