diff --git a/core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index 0e33b75c..7dc3aae5 100644 --- a/core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -275,15 +275,20 @@ public class SessionManager { */ public synchronized void remove(SessionOwner owner) { checkNotNull(owner); - save(sessions.remove(getKey(owner))); + SessionHolder session = sessions.remove(getKey(owner)); + if (session != null) { + save(session); + } } public synchronized void forget(SessionOwner owner) { checkNotNull(owner); UUID key = getKey(owner); SessionHolder holder = sessions.remove(key); - softSessions.put(key, new SoftReference(holder)); - save(holder); + if (holder != null) { + softSessions.put(key, new SoftReference(holder)); + save(holder); + } } /**