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

Nullpointer when setting null values as prefixes #36

Closed
koosg opened this issue Dec 29, 2015 · 1 comment
Closed

Nullpointer when setting null values as prefixes #36

koosg opened this issue Dec 29, 2015 · 1 comment

Comments

@koosg
Copy link

koosg commented Dec 29, 2015

Since the set operation doesn't check if a null is supplied, but simply sets it, we actually have a key-value pair with key - null.
When we then try to override this key, we get a nullpointer exception, since a check exists to see if it is already a known value which isn't null-proof.
To test: add("key", null); add("key","something")
EXCEPTION:java.lang.NullPointerException
at nl.hsac.fitnesse.fixture.util.NamespaceContextImpl.add(NamespaceContextImpl.java:30) [hsac-fitnesse-fixtures-2.4.1.jar]
at nl.hsac.fitnesse.fixture.Environment.registerNamespace(Environment.java:356) [hsac-fitnesse-fixtures-2.4.1.jar]
at nl.hsac.fitnesse.fixture.slim.XmlHttpTest.registerPrefixForNamespace(XmlHttpTest.java:26) [hsac-fitnesse-fixtures-2.4.1.jar]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88) [rt.

@fhoeben
Copy link
Owner

fhoeben commented Dec 29, 2015

you want to ensure no prefix remains in the context after a test, you can place the 'register("key", null)' call in a TearDown page, so it will be executed after a test that actually sets a (non-null) value.

But of course this is a bug and I will fix.

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

2 participants