Skip to content

Commit

Permalink
Fix NullPointerException when stopping a script if the file handler w…
Browse files Browse the repository at this point in the history
…as never initialized
  • Loading branch information
magicmq committed May 16, 2024
1 parent 35794b0 commit 057e0f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/dev/magicmq/pyspigot/util/ScriptLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void initFileHandler() throws IOException {
* Closes the FileHandler for this logger. Should only be called if script file logging is enabled.
*/
public void closeFileHandler() {
handler.close();
if (handler != null)
handler.close();
}

/**
Expand Down

0 comments on commit 057e0f0

Please sign in to comment.