Fixed [object Object] showing when Kill has unknown victim uuid

Improper use of Optional in Map#put

Affects issues
- Close #1675
This commit is contained in:
Risto Lahtela 2021-01-01 11:33:46 +02:00
parent 47633cad37
commit 5401aef681

View File

@ -288,8 +288,8 @@ public class SessionsMutator {
kill -> {
Map<String, Object> killMap = new HashMap<>();
killMap.put("date", formatters.secondLong().apply(kill.getDate()));
killMap.put("victim", kill.getVictimName());
killMap.put("killer", sessionMap.get("player_name"));
killMap.put("victim", kill.getVictimName().orElse(kill.getVictim().toString()));
killMap.put("killer", playerName);
killMap.put("weapon", kill.getWeapon());
return killMap;
}