You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2022/07/24 10:49:00 UTC

[jira] [Commented] (JEXL-374) No exception if dereferencing null object using safe(false) and antish(false)

    [ https://issues.apache.org/jira/browse/JEXL-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17570455#comment-17570455 ] 

Henri Biestro commented on JEXL-374:
------------------------------------

Stopgap measure.
Commit [4d9a57c|https://github.com/apache/commons-jexl/commit/4d9a57cdad3fb5f179328a898735cdd1a47091d6].

> No exception if dereferencing null object using safe(false) and antish(false)
> -----------------------------------------------------------------------------
>
>                 Key: JEXL-374
>                 URL: https://issues.apache.org/jira/browse/JEXL-374
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Alex
>            Assignee: Henri Biestro
>            Priority: Minor
>         Attachments: ObjectContextNullRefTest-1.java
>
>
> I create a JexlEngine as follows:
> new JexlBuilder().cache(512).strict(true).silent(false).safe(false).antish(false).create();
> with these options, I expected that if I evaluate an expression like 'nested.name' and nested is null, that an exception similar to an NPE will be thrown, instead it returns null, the behaviour I would expected if safe were true.  I also noticed that I can put anything like 'foo.name' and it also returns null.  I am including the workaround from JEXL-370.
>  
> I've attached a test class to demonstrate the example. Please let me know if any extra info is needed, and as always, thanks for all the great work on Jexl.
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)