{"record":{"id":"76bfd1a097ea5904","repo":"flowable/flowable-engine","slug":"task-namelikeignorecase-is-null","errorCode":null,"errorMessage":"Task nameLikeIgnoreCase is null","messagePattern":"Task nameLikeIgnoreCase is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":337,"sourceCode":"\n    @Override\n    public TaskQueryImpl taskNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"Task namelike is null\");\n        }\n\n        if (orActive) {\n            currentOrQueryObject.nameLike = nameLike;\n        } else {\n            this.nameLike = nameLike;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskNameLikeIgnoreCase(String nameLikeIgnoreCase) {\n        if (nameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"Task nameLikeIgnoreCase is null\");\n        }\n\n        if (orActive) {\n            currentOrQueryObject.nameLikeIgnoreCase = nameLikeIgnoreCase.toLowerCase();\n        } else {\n            this.nameLikeIgnoreCase = nameLikeIgnoreCase.toLowerCase();\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskDescription(String description) {\n        if (description == null) {\n            throw new FlowableIllegalArgumentException(\"Description is null\");\n        }\n\n        if (orActive) {\n            currentOrQueryObject.description = description;","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L319-L355","documentation":"Flowable throws this FlowableIllegalArgumentException when TaskQuery.taskNameLikeIgnoreCase() is called with a null argument. The query API requires every filter criterion to be a non-null value; null is not a valid filter and would produce an ambiguous SQL condition. The message names the specific parameter so the caller knows which criterion was invalid.","triggerScenarios":"Calling taskQuery.taskNameLikeIgnoreCase(null), e.g. when the value comes from an uninitialized variable, an absent request parameter, or a map lookup that returned null.","commonSituations":"REST controllers passing through optional query parameters without defaulting them; bean-property binding that leaves the filter field null; refactors where a previously set literal was replaced by a possibly-null config value.","solutions":["Pass a non-null string, e.g. an empty-check first: if (namePart != null) query.taskNameLikeIgnoreCase(namePart);","Only add the nameLikeIgnoreCase criterion when the user actually supplied a value (conditional query building).","Default the input to a non-null value such as \"\" if a match-all behavior is acceptable.","Catch FlowableIllegalArgumentException at the API boundary and return a 400 to the client."],"exampleFix":"// before\nquery.taskNameLikeIgnoreCase(request.getNameFilter()); // NPE-ish throw when null\n// after\nif (request.getNameFilter() != null) {\n    query.taskNameLikeIgnoreCase(request.getNameFilter());\n}","handlingStrategy":"validation","validationCode":"if (nameLikeIgnoreCase != null) {\n    query.taskNameLikeIgnoreCase(nameLikeIgnoreCase);\n}","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.taskNameLikeIgnoreCase(value);\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"Invalid nameLikeIgnoreCase filter\", e);\n}","preventionTips":["Always build Flowable queries conditionally, adding each criterion only when its input is non-null.","Centralize query building in one helper that performs null filtering for all criteria.","Validate/normalize request DTOs at the controller layer before touching the query API.","Remember IgnoreIgnoreCase variants lowercase the input, so they need a real string, not null."],"tags":["flowable","task-query","null-argument","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"}