{"record":{"id":"99ce70a4fe6e2ee6","repo":"flowable/flowable-engine","slug":"provided-handlertypes-are-null-99ce70","errorCode":null,"errorMessage":"Provided handlerTypes are null","messagePattern":"Provided handlerTypes are null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java","lineNumber":409,"sourceCode":"    }\n\n    @Override\n    public SuspendedJobQueryImpl handlerType(String handlerType) {\n        if (handlerType == null) {\n            throw new FlowableIllegalArgumentException(\"Provided handlerType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.handlerType = handlerType;\n        } else {\n            this.handlerType = handlerType;\n        }\n        return this;\n    }\n\n    @Override\n    public SuspendedJobQueryImpl handlerTypes(Collection<String> handlerTypes) {\n        if (handlerTypes == null) {\n            throw new FlowableIllegalArgumentException(\"Provided handlerTypes are null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.handlerTypes = handlerTypes;\n        } else {\n            this.handlerTypes = handlerTypes;\n        }\n        return this;\n    }\n\n    @Override\n    public SuspendedJobQueryImpl withRetriesLeft() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.retriesLeft = true;\n        } else {\n            retriesLeft = true;\n        }\n        return this;\n    }","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java#L391-L427","documentation":"SuspendedJobQueryImpl.handlerTypes(Collection<String>) throws FlowableIllegalArgumentException when the collection itself is null. Note it validates only nullness of the collection (an empty collection is accepted); passing null would otherwise corrupt the query filter. As with other setters the value is assigned to the current OR-query object when inside an or() block.","triggerScenarios":"Calling handlerTypes(null) directly, or passing a Collection built from config/user input (e.g. a List<String> parsed from a comma-separated property or request parameter) that was never initialized.","commonSituations":"Filtering suspended jobs by several handler types in admin dashboards where the selected-types list is empty-initialized as null instead of Collections.emptyList(); refactors where a nullable list is forwarded without a check.","solutions":["Pass an explicit non-null collection (Collections.emptyList() or Arrays.asList(...)).","Coalesce null collections at the call site before invoking handlerTypes.","If a null list means 'no filter', add a conditional so the setter is skipped entirely instead of called with null."],"exampleFix":"// before\nquery.handlerTypes(selectedTypes); // NPE-style throw when selectedTypes == null\n// after\nif (selectedTypes != null && !selectedTypes.isEmpty()) {\n    query.handlerTypes(selectedTypes);\n}","handlingStrategy":"validation","validationCode":"if (handlerTypes == null) {\n    handlerTypes = Collections.emptyList();\n}","typeGuard":"Collection<String> nonNullTypes(Collection<String> types) { return types == null ? Collections.emptyList() : types; }","tryCatchPattern":"try {\n    query.handlerTypes(handlerTypes);\n} catch (FlowableIllegalArgumentException e) {\n    // handlerTypes was null; query without the handler-type filter\n}","preventionTips":["Initialize handler-type collections eagerly (empty list, not null).","Null-coalesce config- or request-derived lists at the boundary.","Prefer Optional<Collection<String>> internally and unwrap with a default."],"tags":["flowable","query","null-check","collection","job-service"],"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"}