Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ntdaley opened this issue Oct 23, 2015 · 4 comments
Open

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

ntdaley opened this issue Oct 23, 2015 · 4 comments
Assignees

Comments

@ntdaley
Copy link

ntdaley commented Oct 23, 2015

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
@pekkaklarck
Copy link
Member

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.

@ntdaley
Copy link
Author

ntdaley commented Aug 23, 2016

Any news on this?

@Soothsilver
Copy link

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).

@Hi-Fi
Copy link
Contributor

Hi-Fi commented Dec 7, 2019

ArgumentConverter is removed at #24, but has to check that new ArgumentCollector handles $(None)/null as should.

@Hi-Fi Hi-Fi self-assigned this Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants