Skip to content

Commit

Permalink
Fix filler getter throwing NPE if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
zrdzn committed Apr 29, 2022
1 parent 08570eb commit 150ad13
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.util.List;
import java.util.Map.Entry;
import java.util.Optional;

public class Menu {

Expand Down Expand Up @@ -49,8 +50,8 @@ public int getRows() {
return this.rows;
}

public ItemStack getFiller() {
return this.filler.clone();
public Optional<ItemStack> getFiller() {
return this.filler == null ? Optional.empty() : Optional.of(this.filler.clone());
}

public Entry<String, String> getDropSwitch() {
Expand Down

0 comments on commit 150ad13

Please sign in to comment.