Skip to content

Commit 88915ec

Browse files
committed
Fixed NPE when player gets kicked
1 parent f9b1304 commit 88915ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Plugin/src/main/java/dev/lrxh/neptune/profile/listener/ProfileListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import dev.lrxh.neptune.feature.hotbar.HotbarService;
88
import dev.lrxh.neptune.game.kit.Kit;
99
import dev.lrxh.neptune.game.match.Match;
10+
import dev.lrxh.neptune.game.match.impl.participant.DeathCause;
1011
import dev.lrxh.neptune.game.match.impl.participant.Participant;
1112
import dev.lrxh.neptune.profile.ProfileService;
1213
import dev.lrxh.neptune.profile.data.ProfileState;
@@ -82,8 +83,7 @@ public void onQuit(PlayerQuitEvent event) {
8283
if (participant == null)
8384
return;
8485
match.onLeave(match.getParticipant(player), true);
85-
MatchParticipantDeathEvent deathEvent = new MatchParticipantDeathEvent(match, participant,
86-
participant.getDeathCause().getMessage().getString());
86+
MatchParticipantDeathEvent deathEvent = new MatchParticipantDeathEvent(match, participant, DeathCause.DISCONNECT.getMessage().toString());
8787
Bukkit.getPluginManager().callEvent(deathEvent);
8888
}
8989
}

0 commit comments

Comments
 (0)