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

NullPointerException for list/map field access if field is null #34

Closed
jaccomoc opened this issue Nov 12, 2023 · 0 comments
Closed

NullPointerException for list/map field access if field is null #34

jaccomoc opened this issue Nov 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jaccomoc
Copy link
Owner

When accessing a field of a list or a map and the field is null we get a NullPointerException instead of a NullError which means we get an error like this:

Caused by: java.lang.NullPointerException
	at io.jactl.runtime.RuntimeUtils.loadOther(RuntimeUtils.java:1281)
	at io.jactl.runtime.RuntimeUtils.loadField(RuntimeUtils.java:1252)
	at io.jactl.pkg._$j$Script84F9187761E6A5C4CA88D78E04A6F53D._$j$main(_$j$Script84F9187761E6A5C4CA88D78E04A6F53D.jactl:72)
	at io.jactl.pkg._$j$Script84F9187761E6A5C4CA88D78E04A6F53D._$j$main$$c(_$j$Script84F9187761E6A5C4CA88D78E04A6F53D.jactl)
	at io.jactl.runtime.JactlMethodHandle.invoke(JactlMethodHandle.java:56)
	at io.jactl.runtime.Continuation.doContinue(Continuation.java:176)
	... 9 more

We should get a NullError with a better error message showing exactly where the null value is in the code.

@jaccomoc jaccomoc added the bug Something isn't working label Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant