{"record":{"id":"506f6e43b9f1c404","repo":"flowable/flowable-engine","slug":"name-like-is-null","errorCode":null,"errorMessage":"Name like is null","messagePattern":"Name like is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java","lineNumber":347,"sourceCode":"    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"Name is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.name = name;\n        } else {\n            this.name = name;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"Name like is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.nameLike = nameLike;\n        } else {\n            this.nameLike = nameLike;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceNameLikeIgnoreCase(String nameLikeIgnoreCase) {\n        if (nameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"Name like ignore case is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.nameLikeIgnoreCase = nameLikeIgnoreCase;\n        } else {\n            this.nameLikeIgnoreCase = nameLikeIgnoreCase;","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L329-L365","documentation":"Flowable throws FlowableIllegalArgumentException from CaseInstanceQueryImpl.caseInstanceNameLike(String) when the like pattern is null. Validation is immediate, keeping null out of the SQL layer. A null pattern means 'no filter', so the correct fix is to not call the method rather than pass null.","triggerScenarios":"Calling createCaseInstanceQuery().caseInstanceNameLike(null), typically from an empty/absent 'name contains' search input forwarded as null.","commonSituations":"Search endpoints with optional pattern fields; generic filter-map-to-query builders that don't skip null entries; version upgrades where previously tolerated nulls now throw.","solutions":["Guard the call: if (nameLike != null) query.caseInstanceNameLike(nameLike)","Skip null entries in any generic filter-mapping utility before invoking criteria methods","Use caseInstanceName for exact matches when the full name is available","Catch FlowableIllegalArgumentException and surface a client-facing validation message"],"exampleFix":"// before\nquery.caseInstanceNameLike(search.getNameLike());\n// after\nif (search.getNameLike() != null) {\n    query.caseInstanceNameLike(search.getNameLike());\n}","handlingStrategy":"validation","validationCode":"if (nameLike != null) { query.caseInstanceNameLike(nameLike); }","typeGuard":"boolean hasPattern = (p instanceof String s) && !s.isEmpty();","tryCatchPattern":"try { query.caseInstanceNameLike(pattern); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(\"nameLike must not be null\"); }","preventionTips":["Skip null filter entries before invoking any *Like criteria method","Escape user-supplied like patterns and only then apply them non-null","Add unit tests covering absent-filter cases"],"tags":["flowable","cmmn","query","null-argument"],"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"}