Skip to content

Commit

Permalink
OGNL-102 Improves performance when null was returned
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Nov 23, 2021
1 parent b2e670d commit 137eadc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/ognl/ASTChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ protected Object getValueBody(OgnlContext context, Object source)

for(int i = 0, ilast = _children.length - 1; i <= ilast; ++i)
{

if (result == null) {
break;
}

boolean handled = false;

if (i < ilast) {
Expand Down Expand Up @@ -124,7 +129,7 @@ protected Object getValueBody(OgnlContext context, Object source)
+ "'"); }
}
}
if (!handled)
if (!handled)
{
result = OgnlRuntime.getIndexedProperty(context, result,
propertyNode.getProperty(context, result).toString(),
Expand Down

0 comments on commit 137eadc

Please sign in to comment.