Skip to content

Commit

Permalink
Fix NPE in Slot#handle
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Sep 13, 2017
1 parent 91979a8 commit d58bbc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ Then, you can add dependencies for each helper module.
<dependency>
<groupId>me.lucko</groupId>
<artifactId>helper</artifactId>
<version>2.1.2</version>
<version>2.1.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand All @@ -768,7 +768,7 @@ Then, you can add dependencies for each helper module.
#### Gradle
```gradle
dependencies {
compile ("me.lucko:helper:2.1.2")
compile ("me.lucko:helper:2.1.3")
}
```

Expand Down
2 changes: 1 addition & 1 deletion helper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<artifactId>helper</artifactId>
<packaging>jar</packaging>
<version>2.1.2</version>
<version>2.1.3</version>

<name>helper</name>
<description>A utility to reduce boilerplate code in Bukkit plugins.</description>
Expand Down
3 changes: 3 additions & 0 deletions helper/src/main/java/me/lucko/helper/menu/Slot.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ public Slot clearBindings(ClickType type) {

public void handle(@Nonnull InventoryClickEvent event) {
Set<Consumer<InventoryClickEvent>> handlers = this.handlers.get(event.getClick());
if (handlers == null) {
return;
}
for (Consumer<InventoryClickEvent> handler : handlers) {
try (MCTiming t = Timings.ofStart("helper-gui: " + getClass().getSimpleName() + " : " + Delegate.resolve(handler).getClass().getName())) {
handler.accept(event);
Expand Down

0 comments on commit d58bbc2

Please sign in to comment.