Null check for Swing Event

This commit is contained in:
Kam committed 2024-03-29 01:35:07 -04:00
1 parent 19c6c08d75
commit 60dcef2e29
2 files changed
+2 -3

No files matched your search

@@ -227,7 +227,7 @@ public class NpcEvent extends CustomNPCsEvent implements INpcEvent {
public SwingEvent(ICustomNpc npc, ItemStack itemStack) {
super(npc);
this.itemStack = (IItemStack)NpcAPI.Instance().getIItemStack(itemStack);
this.itemStack = itemStack == null ? null : (IItemStack)NpcAPI.Instance().getIItemStack(itemStack);
}
public String getHookName() {
@@ -237,7 +237,6 @@ public class NpcEvent extends CustomNPCsEvent implements INpcEvent {
/**
* @return Returns the swung item
*/
@Override
public IItemStack getItemStack() {
return itemStack;
}