{"record":{"id":"fb70565618b95c72","repo":"Activiti/Activiti","slug":"assigneelikeignorecase-is-null","errorCode":null,"errorMessage":"assigneeLikeIgnoreCase is null","messagePattern":"assigneeLikeIgnoreCase is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":365,"sourceCode":"        }\n        return this;\n    }\n\n    public TaskQueryImpl taskAssigneeLike(String assigneeLike) {\n        if (assigneeLike == null) {\n            throw new ActivitiIllegalArgumentException(\"AssigneeLike is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.assigneeLike = assigneeLike;\n        } else {\n            this.assigneeLike = assigneeLike;\n        }\n        return this;\n    }\n\n    public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {\n        if (assigneeLikeIgnoreCase == null) {\n            throw new ActivitiIllegalArgumentException(\"assigneeLikeIgnoreCase is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();\n        } else {\n            this.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskAssigneeIds(List<String> assigneeIds) {\n        if (assigneeIds == null) {\n            throw new ActivitiIllegalArgumentException(\"Task assignee list is null\");\n        }\n        if (assigneeIds.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Task assignee list is empty\");\n        }\n        for (String assignee : assigneeIds) {","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L347-L383","documentation":"TaskQueryImpl.taskAssigneeLikeIgnoreCase(String) throws ActivitiIllegalArgumentException when the assigneeLikeIgnoreCase argument is null. This setter lowercases the pattern and performs case-insensitive LIKE matching on the assignee; Activiti validates the argument before calling toLowerCase() so the null cannot cause an NPE deeper down. Pass a non-null pattern string.","triggerScenarios":"Calling taskQuery().taskAssigneeLikeIgnoreCase(null) when the search term is missing, or when the null check is bypassed because the argument expression itself throws/logic passes null (e.g. searchTerm != null ? term : null).","commonSituations":"Case-insensitive search box submitted empty and mapped to null; locale-sensitive preprocessing code that returns null for blank input; unit tests that forget to set the search term field.","solutions":["Check the raw search term for null/blank before building the pattern and calling this setter","Skip the filter when optional: only call taskAssigneeLikeIgnoreCase(term) if term != null","Use searchTerm.trim().isEmpty() checks so blank strings do not become confusing downstream behavior"],"exampleFix":"// before\nquery.taskAssigneeLikeIgnoreCase(searchTerm.toLowerCase());\n// after\nif (searchTerm != null && !searchTerm.trim().isEmpty()) {\n    query.taskAssigneeLikeIgnoreCase(searchTerm.toLowerCase());\n}","handlingStrategy":"validation","validationCode":"if (searchTerm == null || searchTerm.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"search term for case-insensitive assignee match is required\");\n}","typeGuard":"boolean hasIgnoreCaseSearchTerm(String term) {\n    return term != null && !term.trim().isEmpty();\n}","tryCatchPattern":"try {\n    query.taskAssigneeLikeIgnoreCase(searchTerm.toLowerCase());\n} catch (ActivitiIllegalArgumentException e) {\n    if (!\"assigneeLikeIgnoreCase is null\".equals(e.getMessage())) throw e;\n    // skip filter or reject request with a clear message\n}","preventionTips":["Trim and null-check search input before lowercasing","Validate search parameters in the controller/service layer, not inside query building","Prefer explicit Optional handling: Optional.ofNullable(term).ifPresent(query::taskAssigneeLikeIgnoreCase)"],"tags":["null-check","query-builder","activiti","task-query"],"backgroundTag":"null-argument","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}