mirror of
https://github.com/zaaarf/geb-processor.git
synced 2024-11-23 04:34:52 +01:00
fix: avoid nullptr in generated code
This commit is contained in:
parent
d6c1976261
commit
8027656386
1 changed files with 2 additions and 2 deletions
|
@ -215,9 +215,9 @@ public class GEBProcessor extends AbstractProcessor {
|
||||||
for(ListenerContainer listener : ordered) {
|
for(ListenerContainer listener : ordered) {
|
||||||
String varName = String.format("listener%d", done.get(listener.parent));
|
String varName = String.format("listener%d", done.get(listener.parent));
|
||||||
callListenersBuilder
|
callListenersBuilder
|
||||||
.addStatement("for($T l : $L) {", this.listenerInterface, varName)
|
.addStatement("if($L != null) { for($T l : $L) {", varName, this.listenerInterface, varName)
|
||||||
.addStatement(
|
.addStatement(
|
||||||
"if(l != null) (($T) l).$L(($T) $N); }",
|
"if(l != null) (($T) l).$L(($T) $N); } }",
|
||||||
listener.parent,
|
listener.parent,
|
||||||
listener.method.getSimpleName().toString(),
|
listener.method.getSimpleName().toString(),
|
||||||
event,
|
event,
|
||||||
|
|
Loading…
Reference in a new issue