rocker icon indicating copy to clipboard operation
rocker copied to clipboard

Advertised null safe syntax doesn't work

Open bendem opened this issue 8 years ago • 1 comments

The null safe syntax advertised in the docs doesn't work as expected.

The example shows @?user.getName() which generates __internal.renderValue(user.getName(), true);.

If user is null, that will throw a NPE.

bendem avatar Oct 21 '17 19:10 bendem

After reading it again, I do understand that it is expected that only the return value of getName() be null, but I really expected the whole expression to be null safe since there is not ?. syntax. I guess my issue is more of a feature request for null safe dereference (@user?.getName()).

bendem avatar Oct 21 '17 19:10 bendem