{"record":{"id":"95e30bcc22b5057b","repo":"flowable/flowable-engine","slug":"name-like-ignore-case-is-null","errorCode":null,"errorMessage":"Name like ignore case is null","messagePattern":"Name like ignore case 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":360,"sourceCode":"    }\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;\n        }\n        return this;\n    }\n\n    @Override\n    public CaseInstanceQuery caseInstanceRootScopeId(String rootScopeId) {\n        if (rootScopeId == null) {\n            throw new FlowableIllegalArgumentException(\"rootScopeId is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.rootScopeId = rootScopeId;\n        } else {\n            this.rootScopeId = rootScopeId;","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java#L342-L378","documentation":"Flowable throws FlowableIllegalArgumentException from CaseInstanceQueryImpl.caseInstanceNameLikeIgnoreCase(String) when the case-insensitive pattern is null. The method rejects null eagerly at query construction so it never reaches the database. Omit the criterion when no pattern is supplied.","triggerScenarios":"Calling createCaseInstanceQuery().caseInstanceNameLikeIgnoreCase(null) because an optional case-insensitive search term was null (absent query param, missing JSON field, unset variable).","commonSituations":"Case-insensitive case-instance search features; API gateways forwarding null for missing parameters; refactors normalizing empty strings to null before query building.","solutions":["Conditionally apply: if (pattern != null) query.caseInstanceNameLikeIgnoreCase(pattern)","Normalize input handling so 'not provided' results in skipping the criterion, not passing null","Use caseInstanceNameIgnoreCase for exact case-insensitive matching when appropriate","Catch FlowableIllegalArgumentException to convert it into a validation error response"],"exampleFix":"// before\nquery.caseInstanceNameLikeIgnoreCase(term); // term may be null\n// after\nif (term != null) {\n    query.caseInstanceNameLikeIgnoreCase(term);\n}","handlingStrategy":"validation","validationCode":"if (pattern != null) { query.caseInstanceNameLikeIgnoreCase(pattern); }","typeGuard":"boolean hasPattern = (p instanceof String s) && s.length() > 0;","tryCatchPattern":"try { query.caseInstanceNameLikeIgnoreCase(pattern); } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(\"nameLikeIgnoreCase must not be null\"); }","preventionTips":["Treat null as 'no filter' for all case-insensitive like criteria","Do not normalize empty search terms to null before deciding whether to apply the filter","Catch FlowableIllegalArgumentException at the API layer to produce clear client errors"],"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"}