mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-13 17:01:21 +01:00
Fix possible errors with ItemStacks
This commit is contained in:
parent
2c94175a23
commit
207628ae62
@ -64,7 +64,7 @@ public class ItemDatabase {
|
||||
*/
|
||||
public String getItemCode(ItemStack item) {
|
||||
try {
|
||||
ItemStack clone = item.clone();
|
||||
ItemStack clone = new ItemStack(item);
|
||||
clone.setAmount(1);
|
||||
|
||||
String code = Base64.encodeObject(yaml.dump(clone));
|
||||
@ -78,6 +78,8 @@ public class ItemDatabase {
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user