mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
Fix null pointer
Former-commit-id: 3ac9166cae5345f04e26b7dc000c1470f3cd6cf9
This commit is contained in:
1 parent
ad5fabed1e
commit
73344fe332
2 files changed
+7
-2
No files matched your search
@@ -107,7 +107,12 @@ public class MsgUtil {
|
||||
}
|
||||
public static String getItemi18n(String ItemBukkitName) {
|
||||
ItemBukkitName = ItemBukkitName.trim().replaceAll(" ", "_").toUpperCase(Locale.ROOT);
|
||||
String Itemname_i18n = itemi18n.getString("itemi18n."+ItemBukkitName).trim();
|
||||
String Itemname_i18n = null;
|
||||
try {
|
||||
Itemname_i18n = itemi18n.getString("itemi18n."+ItemBukkitName).trim().replaceAll(" ", "_");
|
||||
}catch (Exception e) {
|
||||
Itemname_i18n = null;
|
||||
}
|
||||
if(ItemBukkitName==null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ public class Util {
|
||||
ItemStack is = itemStack.clone();
|
||||
is.setAmount(1);
|
||||
|
||||
String name = MsgUtil.getItemi18n(itemStack.getType().name());
|
||||
String name = MsgUtil.getItemi18n(itemStack.getType().name()).trim();
|
||||
|
||||
String[] nameParts = name.split("_");
|
||||
if (nameParts.length==1) {
|
||||
|
||||
Reference in new issue
Block a user