Skip to content
This repository was archived by the owner on Jul 24, 2021. It is now read-only.

Commit 2c568db

Browse files
authored
🐛 Fix a NPE
1 parent d126846 commit 2c568db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/fr/bakaaless/api/inventory/InventoryAPI.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,16 @@ private Inventory generate() {
478478
@EventHandler
479479
public void onClose(final InventoryCloseEvent e) {
480480
if (e.getView().getTopInventory().equals(this.inventory)) {
481+
if (this.closeEvent != null)
482+
this.closeEvent.accept(e);
481483
this.stop();
482-
this.closeEvent.accept(e);
483484
}
484485
if (!e.getInventory().equals(this.inventory))
485486
return;
486487
if (e.getInventory().getHolder() == null) {
488+
if (this.closeEvent != null)
489+
this.closeEvent.accept(e);
487490
this.stop();
488-
this.closeEvent.accept(e);
489491
}
490492
}
491493

0 commit comments

Comments
 (0)