Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #146 from prism/fix/shutdown-exception
Browse files Browse the repository at this point in the history
Fix NullPointerException on Shutdown
  • Loading branch information
viveleroi authored Sep 3, 2019
2 parents 9cb5fdd + bfbd0fe commit 49879a1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/com/helion3/prism/Prism.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,14 @@ public void onStoppedServer(GameStoppedServerEvent event) {
// Cancel all scheduled tasks
Sponge.getScheduler().getScheduledTasks(getInstance()).forEach(Task::cancel);

// Flush any pending records
// If the scheduled task is still running this will block until it completes
recordingQueueManager.run();
if (getStorageAdapter() != null) {
// Flush any pending records
// If the scheduled task is still running this will block until it completes
recordingQueueManager.run();

// Shutdown storage
getStorageAdapter().close();
// Shutdown storage
getStorageAdapter().close();
}
}

public static Prism getInstance() {
Expand Down

0 comments on commit 49879a1

Please sign in to comment.