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

object.property throws null pointer exception. #11

Open
chetanjanadri opened this issue Aug 10, 2020 · 2 comments
Open

object.property throws null pointer exception. #11

chetanjanadri opened this issue Aug 10, 2020 · 2 comments

Comments

@chetanjanadri
Copy link

object.property throws null pointer exception when object is defined and there is no property.
Ideally it should not throw an exception instead return null or undefined.

example:
let obj = {a: 1, b: 2} is present in the context
and when I try to evaluate the expression like "obj.c == 3 ? true : false" it throws null pointer exception.

I can see nullSafeNavigation is false for me. is there a way I can make it true so that it returns null.

@krailler
Copy link

krailler commented Aug 24, 2020

Can you try obj?.c == 3 or obj.c? == 3?

@Cicko
Copy link

Cicko commented Sep 30, 2020

I had that problem too. What I had to do is to manually check for the property before its evaluation and set obj.c = null.
This library still has a lot of things to improve. But it seems pretty dead :/

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

3 participants