Skip to content

Passing ${None} to a Java keyword fails with a NPE #17

@ntdaley

Description

@ntdaley

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:
#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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions