Added a few guard conditions to shutdown code.
In some cases (such as another mod crashing on startup or something), the server shutdown even was getting called before anything was actually initialize. In these cases, some uninitialized objects were having cleanup methods called on them, when they were null. There are now guard conditions to prevent the resulting NPE's.
This commit is contained in:
parent
e0ffcaa98d
commit
337f0240a6
1 changed files with 6 additions and 3 deletions
|
@ -318,14 +318,17 @@ public class mod_pocketDim
|
|||
try
|
||||
{
|
||||
PocketManager.tryUnload();
|
||||
deathTracker.writeToFile();
|
||||
deathTracker = null;
|
||||
if (deathTracker != null) {
|
||||
deathTracker.writeToFile();
|
||||
deathTracker = null;
|
||||
}
|
||||
worldProperties = null;
|
||||
currrentSaveRootDirectory = null;
|
||||
|
||||
// Unregister all tick receivers from serverTickHandler to avoid leaking
|
||||
// scheduled tasks between single-player game sessions
|
||||
serverTickHandler.unregisterReceivers();
|
||||
if (serverTickHandler != null)
|
||||
serverTickHandler.unregisterReceivers();
|
||||
spawner = null;
|
||||
riftRegenerator = null;
|
||||
limboDecayScheduler = null;
|
||||
|
|
Loading…
Reference in a new issue