Fix NPE on server shutdown with no user data

This commit is contained in:
nossr50 2019-06-09 05:07:34 -07:00
parent 1d7919c050
commit a677450d50
3 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.72
Fixed a NPE if a server shutdown with no player data needing to be saved (the error is harmless but spammy)
Version 2.1.71
Salvage will now always ask for confirmation before breaking your items (instead of only asking for enchanted items)
Repair will now always ask for confirmation before repairing items (instead of only asking for enchanted items)

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.71</version>
<version>2.1.72-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -66,6 +66,9 @@ public final class UserManager {
* Save all users ON THIS THREAD.
*/
public static void saveAll() {
if(playerDataSet == null)
return;
ImmutableList<McMMOPlayer> trackedSyncData = ImmutableList.copyOf(playerDataSet);
mcMMO.p.getLogger().info("Saving mcMMOPlayers... (" + trackedSyncData.size() + ")");