{"record":{"id":"f6a446ad67e6497c","repo":"flowable/flowable-engine","slug":"categorylike-is-null-f6a446","errorCode":null,"errorMessage":"categoryLike is null","messagePattern":"categoryLike is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java","lineNumber":76,"sourceCode":"    @Override\n    public ModelQueryImpl modelId(String modelId) {\n        this.id = modelId;\n        return this;\n    }\n\n    @Override\n    public ModelQueryImpl modelCategory(String category) {\n        if (category == null) {\n            throw new ActivitiIllegalArgumentException(\"category is null\");\n        }\n        this.category = category;\n        return this;\n    }\n\n    @Override\n    public ModelQueryImpl modelCategoryLike(String categoryLike) {\n        if (categoryLike == null) {\n            throw new ActivitiIllegalArgumentException(\"categoryLike is null\");\n        }\n        this.categoryLike = categoryLike;\n        return this;\n    }\n\n    @Override\n    public ModelQueryImpl modelCategoryNotEquals(String categoryNotEquals) {\n        if (categoryNotEquals == null) {\n            throw new ActivitiIllegalArgumentException(\"categoryNotEquals is null\");\n        }\n        this.categoryNotEquals = categoryNotEquals;\n        return this;\n    }\n\n    @Override\n    public ModelQueryImpl modelName(String name) {\n        if (name == null) {\n            throw new ActivitiIllegalArgumentException(\"name is null\");","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java#L58-L94","documentation":"ModelQueryImpl.modelCategoryLike(String) applies a LIKE-style filter on model category and requires a non-null pattern. Null cannot form a valid LIKE predicate, so ActivitiIllegalArgumentException is thrown.","triggerScenarios":"repositoryService.createModelQuery().modelCategoryLike(pattern) with a null pattern, e.g. a search box value or config value that was never set.","commonSituations":"Client sends empty/absent search term mapped to null; dynamic query builder adds the like-filter unconditionally; a '%' wildcard variable not initialized.","solutions":["Check the pattern for null (and probably blank) before calling modelCategoryLike","Skip the filter entirely when the search term is absent","Coalesce to a default pattern if a filter is always required"],"exampleFix":"// before\nquery.modelCategoryLike(searchTerm);\n// after\nif (searchTerm != null && !searchTerm.isEmpty()) {\n    query.modelCategoryLike(\"%\" + searchTerm + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (categoryLike != null && !categoryLike.trim().isEmpty()) { query.modelCategoryLike(\"%\" + categoryLike.trim() + \"%\"); }","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.modelCategoryLike(pattern);\n} catch (ActivitiIllegalArgumentException e) {\n    // execute query without the like filter\n}","preventionTips":["Treat empty search inputs as 'no filter', not null patterns","Escape user-supplied LIKE wildcards","Build filters in a small helper that centralizes null checks"],"tags":["java","flowable","model-query","null-check","like-filter"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:30:33.424Z"}