You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NPE in onPlayerJoin when no session is stored (3.5.5) #99
Hi, on 3.5.5 (Paper 26.3) every player's first join after a restart throws this:
Could not pass event PlayerJoinEvent to AFKPlus v3.5.5
java.lang.NullPointerException: Cannot invoke "net.lapismc.afkplus.playerdata.AFKSession.processReconnect(net.lapismc.afkplus.playerdata.AFKPlusPlayer)" because "session" is null
at net.lapismc.afkplus.AFKPlusListeners.onPlayerJoin(AFKPlusListeners.java:74)
If there's no stored session and the player isn't AFK, it falls into the else branch and calls processReconnect on null. Came in with c22ca6e I think.
Something like this should do it:
if (session == null) {
if (player.isAFK())
player.forceStopAFK();
} else {
session.processReconnect(player);
}
AFK detection itself still works fine, it's just the error in console. Thanks!
Thank you for the report, not sure how I didn't hit this in testing. I must have been restarting my test server between sessions. Update should be out everywhere.
Activity
Update 3.5.6 NPE Fix
Dart2112 commentedon Oct 18, 2026
Thank you for the report, not sure how I didn't hit this in testing. I must have been restarting my test server between sessions. Update should be out everywhere.