{"record":{"id":"501a0983b0d11082","repo":"flowable/flowable-engine","slug":"value-is-null-501a09","errorCode":null,"errorMessage":"value is null","messagePattern":"value is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/AbstractVariableQueryImpl.java","lineNumber":81,"sourceCode":"\n    public T variableValueEquals(Object value) {\n        return variableValueEquals(value, true);\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public T variableValueEquals(Object value, boolean localScope) {\n        queryVariableValues.add(new QueryVariableValue(null, value, QueryOperator.EQUALS, localScope));\n        return (T) this;\n    }\n\n    public T variableValueEqualsIgnoreCase(String name, String value) {\n        return variableValueEqualsIgnoreCase(name, value, true);\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public T variableValueEqualsIgnoreCase(String name, String value, boolean localScope) {\n        if (value == null) {\n            throw new ActivitiIllegalArgumentException(\"value is null\");\n        }\n        addVariable(name, value.toLowerCase(), QueryOperator.EQUALS_IGNORE_CASE, localScope);\n        return (T) this;\n    }\n\n    public T variableValueNotEqualsIgnoreCase(String name, String value) {\n        return variableValueNotEqualsIgnoreCase(name, value, true);\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public T variableValueNotEqualsIgnoreCase(String name, String value, boolean localScope) {\n        if (value == null) {\n            throw new ActivitiIllegalArgumentException(\"value is null\");\n        }\n        addVariable(name, value.toLowerCase(), QueryOperator.NOT_EQUALS_IGNORE_CASE, localScope);\n        return (T) this;\n    }\n","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/AbstractVariableQueryImpl.java#L63-L99","documentation":"ActivitiIllegalArgumentException thrown by AbstractVariableQueryImpl.variableValueEqualsIgnoreCase when the value argument is null. Ignore-case comparisons require a non-null String because the engine calls value.toLowerCase() immediately after the null check. The library validates eagerly at query-build time rather than failing later at query execution.","triggerScenarios":"Calling taskService.createTaskQuery().taskVariableValueEqualsIgnoreCase(name, null) (or processInstance/candidate variants) with a null value; also the localScope overload variableValueEqualsIgnoreCase(name, null, true/false).","commonSituations":"The variable value comes from user input, an HTTP request parameter, an optional configuration field, or a database column that is NULL, and the code passes it straight into the ignore-case query builder.","solutions":["Check that the value is a non-null String before calling variableValueEqualsIgnoreCase; skip or branch the query when it is null.","If a null means 'no filter', build the query conditionally instead of passing null.","If null should match null variables, use variableValueEquals(name, null) instead, since null is only legal for EQUALS/NOT_EQUALS."],"exampleFix":"// before\nquery.taskVariableValueEqualsIgnoreCase(\"status\", statusFilter);\n// after\nif (statusFilter != null) {\n    query.taskVariableValueEqualsIgnoreCase(\"status\", statusFilter);\n}","handlingStrategy":"validation","validationCode":"if (name != null && value instanceof String && !((String) value).isEmpty()) {\n    query.taskVariableValueEqualsIgnoreCase(name, (String) value);\n}","typeGuard":"boolean isNonEmptyString(Object o) { return o instanceof String && !((String) o).isEmpty(); }","tryCatchPattern":"try {\n    query.taskVariableValueEqualsIgnoreCase(name, value);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Skipping ignore-case filter: {}\", e.getMessage());\n    // rebuild query without the condition\n}","preventionTips":["Null-check optional filter values before building variable queries","Remember null variable matches require variableValueEquals(name, null), not the ignore-case variant","Centralize query-building in a helper that sanitizes inputs once"],"tags":["activiti","query","null-check","validation"],"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"}