When User B accepts a buddy request from User A via MESSENGER_ACCEPTBUDDY, Kepler NPEs in MessengerUser's constructor because PlayerManager.getMessengerData() returned a null PlayerDetails for User A.
This happens even when:
Both users exist in the users table
A valid messenger_requests row exists pointing from User A to User B
(potentially) when User A is not currently online
java.lang.NullPointerException: Cannot invoke "PlayerDetails.getId()" because "details" is null
at MessengerUser.<init>(MessengerUser.java:20)
at Messenger.<init>(Messenger.java:36)
at PlayerManager.getMessengerData(PlayerManager.java:133)
at MESSENGER_ACCEPTBUDDY.acceptBuddy(MESSENGER_ACCEPTBUDDY.java:35)
at MESSENGER_ACCEPTBUDDY.handle(MESSENGER_ACCEPTBUDDY.java:22)
Suggested fix: null-check details in getMessengerData (or fall back to loading from database when offline). Also possibly null-check in MessengerUser's constructor to fail gracefully rather than NPE.
Reproducible on Kepler v1.6, with a fresh database having only two users (the requester and the recipient).
When User B accepts a buddy request from User A via MESSENGER_ACCEPTBUDDY, Kepler NPEs in MessengerUser's constructor because PlayerManager.getMessengerData() returned a null PlayerDetails for User A.
This happens even when:
Both users exist in the users table
A valid messenger_requests row exists pointing from User A to User B
(potentially) when User A is not currently online
Suggested fix: null-check details in getMessengerData (or fall back to loading from database when offline). Also possibly null-check in MessengerUser's constructor to fail gracefully rather than NPE.
Reproducible on Kepler v1.6, with a fresh database having only two users (the requester and the recipient).