mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 01:27:42 +01:00
Fix NPE when gamemode is null on Mohist
This commit is contained in:
parent
4bb6c9f978
commit
2f78f5528e
@ -51,6 +51,7 @@ import javax.inject.Inject;
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional
|
||||
import java.util.UUID;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@ -165,7 +166,7 @@ public class PlayerOnlineListener implements Listener {
|
||||
BukkitAFKListener.afkTracker.performedAction(playerUUID, time);
|
||||
|
||||
String world = player.getWorld().getName();
|
||||
String gm = player.getGameMode().name();
|
||||
String gm = Optional.of(player.getGameMode()).map(gameMode -> gameMode.name()).orElse("Unknown");
|
||||
|
||||
Database database = dbSystem.getDatabase();
|
||||
database.executeTransaction(new WorldNameStoreTransaction(serverUUID, world));
|
||||
|
Loading…
Reference in New Issue
Block a user