Activiti/Activiti · error · ActivitiIllegalArgumentException

assigneeLikeIgnoreCase is null

Error message

assigneeLikeIgnoreCase is null

What it means

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.

Solutions

  1. Check the raw search term for null/blank before building the pattern and calling this setter
  2. Skip the filter when optional: only call taskAssigneeLikeIgnoreCase(term) if term != null
  3. Use searchTerm.trim().isEmpty() checks so blank strings do not become confusing downstream behavior

Example fix

// before
query.taskAssigneeLikeIgnoreCase(searchTerm.toLowerCase());
// after
if (searchTerm != null && !searchTerm.trim().isEmpty()) {
    query.taskAssigneeLikeIgnoreCase(searchTerm.toLowerCase());
}
Defensive patterns

Strategy: validation

Validate before calling

if (searchTerm == null || searchTerm.trim().isEmpty()) {
    throw new IllegalArgumentException("search term for case-insensitive assignee match is required");
}

Type guard

boolean hasIgnoreCaseSearchTerm(String term) {
    return term != null && !term.trim().isEmpty();
}

Try / catch

try {
    query.taskAssigneeLikeIgnoreCase(searchTerm.toLowerCase());
} catch (ActivitiIllegalArgumentException e) {
    if (!"assigneeLikeIgnoreCase is null".equals(e.getMessage())) throw e;
    // skip filter or reject request with a clear message
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09). Data as JSON: /api/errors/fb70565618b95c72. Report an issue: GitHub.

Appendix: source

Thrown at activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java:365

        }
        return this;
    }

    public TaskQueryImpl taskAssigneeLike(String assigneeLike) {
        if (assigneeLike == null) {
            throw new ActivitiIllegalArgumentException("AssigneeLike is null");
        }
        if (orActive) {
            currentOrQueryObject.assigneeLike = assigneeLike;
        } else {
            this.assigneeLike = assigneeLike;
        }
        return this;
    }

    public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {
        if (assigneeLikeIgnoreCase == null) {
            throw new ActivitiIllegalArgumentException("assigneeLikeIgnoreCase is null");
        }
        if (orActive) {
            currentOrQueryObject.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();
        } else {
            this.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();
        }
        return this;
    }

    @Override
    public TaskQuery taskAssigneeIds(List<String> assigneeIds) {
        if (assigneeIds == null) {
            throw new ActivitiIllegalArgumentException("Task assignee list is null");
        }
        if (assigneeIds.isEmpty()) {
            throw new ActivitiIllegalArgumentException("Task assignee list is empty");
        }
        for (String assignee : assigneeIds) {

View on GitHub (pinned to 56435b1a97)