henrib commented on code in PR #425:
URL: https://github.com/apache/commons-jexl/pull/425#discussion_r4551624276


##########
src/main/java/org/apache/commons/jexl3/internal/Interpreter.java:
##########
@@ -1736,9 +1736,9 @@ private Object visit(final ASTMethodNode node, final 
Object antish, final Object
         for (int a = 1; a < node.jjtGetNumChildren(); ++a) {
             if (result == null) {
                 // no method, we fail// variable unknown in context and not a 
local
-                return node.isSafeLhs(isSafe())
+                return isSafeUndefined() && node.isSafeLhs(isSafe())
                         ? null
-                        : unsolvableMethod(methodNode, "<?>.<null>(...)");
+                        : unsolvableMethod(node, "<?>.<null>(...)");

Review Comment:
   Intended: the ternary, `?:` and `??` protection walks up from the node the 
error is raised on, and stops at the method node when started from its first 
child. Raised from `methodNode`, a call on a null result such as 
`map.get('z')(1) ?? 1` is an error on a strict engine; raised from `node`, it 
evaluates as 1, as the other method errors do. 4e2f8b35 adds that expression to 
`test476`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to