Passing ${None} to a Java keyword fails with a NPE
In an older version of Robotframework that my company was previously using, we were able to pass ${None} in to Java keywords, and the keyword would get null. After upgrading to the current version, this fails with a NullPointerException. (Stacktrace shown below)
It looks like my build environment is using JavalibCore 1.2
There appears to be a pull-request already containing a fix for this: https://github.com/robotframework/JavalibCore/pull/15
java.lang.RuntimeException:
at org.robotframework.javalib.reflection.KeywordInvoker.invoke(KeywordInvoker.java:52)
at org.robotframework.javalib.beans.annotation.AnnotationKeywordExtractor$1.execute(AnnotationKeywordExtractor.java:62)
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.runKeyword(KeywordFactoryBasedLibrary.java:37)
at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:128)
at robot.model.testcase$py.visit$7(/Users/jmalinen/Documents/workspace/robotframework/tmp-jar-dir/Lib/robot/model/testcase.py:64)
at robot.model.testcase$py.call_function(/Users/jmalinen/Documents/workspace/robotframework/tmp-jar-dir/Lib/robot/model/testcase.py)
at robot.model.itemlist$py.visit$10(/Users/jmalinen/Documents/workspace/robotframework/tmp-jar-dir/Lib/robot/model/itemlist.py:58)
at robot.model.itemlist$py.call_function(/Users/jmalinen/Documents/workspace/robotframework/tmp-jar-dir/Lib/robot/model/itemlist.py)
...
Caused by: java.lang.NullPointerException
at org.robotframework.javalib.reflection.ArgumentConverter.isArrayArgument(ArgumentConverter.java:44)
at org.robotframework.javalib.reflection.ArgumentConverter.internalConvert(ArgumentConverter.java:26)
at org.robotframework.javalib.reflection.ArgumentConverter.convertArguments(ArgumentConverter.java:16)
at org.robotframework.javalib.reflection.KeywordInvoker.invoke(KeywordInvoker.java:49)
... 310 more
Thanks for submitting an issue. It seems we have somehow missed PR #15. @jussimalinen is currently on holiday, but I hope he has time to look at this when he's back.
Any news on this?
I don't think PR #15 is going to be enough to solve this.
I'm getting a null pointer exception also at ArgumentGrouper.java at line 48 (where ungroupedArguments[i] is a null).
ArgumentConverter is removed at #24, but has to check that new ArgumentCollector handles $(None)/null as should.