Dear Flowable experts,
org.flowable.common.engine.impl.de.odysseus.el.tree.impl.ast.AstProperty#eval
starts with the the following code:
Object base = prefix.eval(bindings, context);
if (base == null) {
return null;
}
Object property = getProperty(bindings, context);
if (property == null && strict) {
return null;
}
...
As a result, when a custom expression is resolved (e.g. ${customApi.nonExistingObject.nonExistingProperty}
), when nonExistingObject
equals null and is a base, evaluation of nonExistingProperty
returns null
. Expectation would be that there is actually an exception thrown.
We’ve tried to incorporate this logic into a custom ELResolver
, but short circuiting to null
when base is null
results in ELResolvers
not coming into play for nonExistingProperty
.
Would you see any drawbacks in the following potential contribution from our side for the start of the eval?
Object base = prefix.eval(bindings, context);
Object property = getProperty(bindings, context);
if (base == null) {
if (property != null){
throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", property, base));
}
return null;
}
if (property == null && strict) {
return null;
}
Thank you very much in advance!
Best regards,
Vasil Tsimashchuk