fix(gui): check empty name/skin

This commit is contained in:
ineanto 2023-11-23 23:38:18 +01:00
parent 95cb60a6b3
commit 2cf7f4c8d4
2 changed files with 14 additions and 6 deletions

View file

@ -36,7 +36,11 @@ public class PlayerInformationItem extends AsyncItem {
if (optionalProfile.isPresent()) {
final NickoProfile profile = optionalProfile.get();
final ItemTranslation translation = i18n.translateItem(I18NDict.GUI.Admin.CHECK, player.getName(), (profile.hasData() ? "§a✔" : "§c❌"), profile.getName(), profile.getSkin());
final ItemTranslation translation = i18n.translateItem(I18NDict.GUI.Admin.CHECK,
player.getName(),
(profile.hasData() ? "§a✔" : "§c❌"),
(profile.getName() == null ? "§cN/A" : profile.getName()),
(profile.getSkin() == null ? "§cN/A" : profile.getSkin()));
skull.setDisplayName("§6" + translation.getName());
translation.getLore().forEach(skull::addLoreLines);
} else {