summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/ftbsc/geb/processor/GEBProcessor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/ftbsc/geb/processor/GEBProcessor.java b/src/main/java/ftbsc/geb/processor/GEBProcessor.java
index 60ba4ff..57655cd 100644
--- a/src/main/java/ftbsc/geb/processor/GEBProcessor.java
+++ b/src/main/java/ftbsc/geb/processor/GEBProcessor.java
@@ -215,9 +215,9 @@ public class GEBProcessor extends AbstractProcessor {
for(ListenerContainer listener : ordered) {
String varName = String.format("listener%d", done.get(listener.parent));
callListenersBuilder
- .addStatement("for($T l : $L) {", this.listenerInterface, varName)
+ .addStatement("if($L != null) { for($T l : $L) {", varName, this.listenerInterface, varName)
.addStatement(
- "if(l != null) (($T) l).$L(($T) $N); }",
+ "if(l != null) (($T) l).$L(($T) $N); } }",
listener.parent,
listener.method.getSimpleName().toString(),
event,