Skip to content

Commit

Permalink
avoiding crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jun 25, 2024
1 parent a89c886 commit b2d3025
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public void log(Level level, String msg) {
super.log(level, msg);
if(true/*debuglog*/) {
try {
writer.write(String.format("[%s] %s: %s%n", java.time.LocalDateTime.now(), level, msg));
writer.flush();
if(writer != null) {
writer.write(String.format("[%s] %s: %s%n", java.time.LocalDateTime.now(), level, msg));
writer.flush();
}
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit b2d3025

Please sign in to comment.