{"record":{"id":"767ff68945286162","repo":"flowable/flowable-engine","slug":"error-property-base-null","errorCode":null,"errorMessage":"error.property.base.null","messagePattern":"error\\.property\\.base\\.null","errorType":"exception","errorClass":"PropertyNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/ast/AstMethod.java","lineNumber":89,"sourceCode":"\t\n\t@Override\n\tpublic final ValueReference getValueReference(Bindings bindings, ELContext context) {\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic void appendStructure(StringBuilder builder, Bindings bindings) {\n\t\tproperty.appendStructure(builder, bindings);\n\t\tparams.appendStructure(builder, bindings);\n\t}\n\n\tprotected Object eval(Bindings bindings, ELContext context, boolean answerNullIfBaseIsNull) {\n\t\tObject base = property.getPrefix().eval(bindings, context);\n\t\tif (base == null) {\n\t\t\tif (answerNullIfBaseIsNull) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthrow new PropertyNotFoundException(LocalMessages.get(\"error.property.base.null\", property.getPrefix()));\n\t\t}\n\t\tObject method = property.getProperty(bindings, context);\n\t\tif (method == null) {\n\t\t\tthrow new PropertyNotFoundException(LocalMessages.get(\"error.property.method.notfound\", \"null\", base));\n\t\t}\n\t\tString name = bindings.convert(method, String.class);\n\n\t\tcontext.setPropertyResolved(false);\n\t\tObject result = context.getELResolver().invoke(context, base, name, null, params.eval(bindings, context));\n\t\tif (!context.isPropertyResolved()) {\n\t\t\tthrow new MethodNotFoundException(LocalMessages.get(\"error.property.method.notfound\", name, base.getClass()));\n\t\t}\n\t\treturn result;\n\t}\n\n\t@Override\n\tpublic Object eval(Bindings bindings, ELContext context) {\n\t\treturn eval(bindings, context, true);","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/ast/AstMethod.java#L71-L107","documentation":"AstMethod.eval first evaluates the prefix (base object) of a method expression. If the base is null and the caller did not request null-on-null-base, it throws PropertyNotFoundException('error.property.base.null'), meaning the object on which a method was invoked evaluated to null.","triggerScenarios":"Expressions like ${person.getName()} where 'person' is null or resolves to null (uninitialized variable, missing process variable, resolver returning null); chained calls on possibly-null paths like ${a.b.method()} where a.b is null.","commonSituations":"Missing process/context variables in Flowable; bean not registered in the EL context; typo in variable name; data not yet loaded when expression is evaluated.","solutions":["Ensure the base variable is set before evaluation (initialize the bean or process variable).","Add safe-navigation or a guard: ${person != null ? person.getName() : ''}.","Correct the variable name in the expression if it was misspelled.","Register the expected bean in the ELResolver/ELContext so the prefix resolves."],"exampleFix":"// before\n${order.customer.getName()} // customer is null\n// after\n${order.customer != null ? order.customer.getName() : 'unknown'}","handlingStrategy":"validation","validationCode":"Object base = factory.createValueExpression(ctx, \"${person}\", Object.class).getValue(context);\nif (base == null) throw new IllegalStateException(\"Base object 'person' is null; cannot invoke method\");","typeGuard":"boolean baseResolved(String exprPrefix, ELContext ctx) {\n    return factory.createValueExpression(ctx, \"${\" + exprPrefix + \"}\", Object.class).getValue(ctx) != null;\n}","tryCatchPattern":"try {\n    return expr.getValue(context);\n} catch (PropertyNotFoundException e) {\n    if (!e.getMessage().contains(\"base.null\")) throw e;\n    return null; // or initialize the base and retry\n}","preventionTips":["Initialize all base beans/variables before evaluating expressions","Guard chains with explicit null checks (${a != null and a.b != null ? ...})","Register required beans in the ELResolver and fail fast at startup if absent"],"tags":["el","expression-language","null-base","property-not-found"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}