diff options
author | zaaarf <me@zaaarf.foo> | 2024-08-30 12:20:46 +0200 |
---|---|---|
committer | zaaarf <me@zaaarf.foo> | 2024-08-30 12:20:46 +0200 |
commit | 8027656386cc3023d428ea0382358244027396df (patch) | |
tree | c8bb92872f1fc0a22f776780a730977ecc886544 | |
parent | d6c1976261a7d2b17f910dd6b76804f7401a1858 (diff) |
fix: avoid nullptr in generated code0.2.1
-rw-r--r-- | src/main/java/ftbsc/geb/processor/GEBProcessor.java | 4 |
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, |