Handle invalid translations

This commit is contained in:
mathiascode 2020-01-04 23:18:18 +02:00
parent 33f6f3cb28
commit 2738bc3647
1 changed files with 6 additions and 1 deletions

View File

@ -24,7 +24,12 @@ public final class PlayerUseWeapon implements Listener {
&& event.getItem().getItemMeta().hasDisplayName()) {
final Action action = event.getAction();
final Material item = event.getMaterial();
final String name = event.getItem().getItemMeta().getDisplayName();
String name = "";
try {
name = event.getItem().getItemMeta().getDisplayName();
} catch (Exception ignored) {
}
if (action == Action.LEFT_CLICK_AIR
|| action == Action.LEFT_CLICK_BLOCK) {