mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 18:09:48 -05:00
Fix NPE when printing Null value enchantment (Rollbar#156)
This commit is contained in:
1 parent
693c91db55
commit
2a8159bc4a
1 file changed
+3
-1
@@ -905,7 +905,9 @@ public class MsgUtil {
|
||||
|
||||
private static void printEnchantment(ChatSheetPrinter chatSheetPrinter, Map<Enchantment, Integer> enchs) {
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
chatSheetPrinter.printLine(ChatColor.YELLOW + MsgUtil.getEnchi18n(entries.getKey()) + " " + RomanNumber.toRoman(entries.getValue()));
|
||||
//Use boxed object to avoid NPE
|
||||
Integer level = entries.getValue();
|
||||
chatSheetPrinter.printLine(ChatColor.YELLOW + MsgUtil.getEnchi18n(entries.getKey()) + " " + RomanNumber.toRoman(level == null ? 1 : level));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user