{"record":{"id":"3d154f99e614dcd3","repo":"jd-opensource/joyagent-jdgenie","slug":"vectoridlist-is-null","errorCode":null,"errorMessage":"vectorIdList is null!","messagePattern":"vectorIdList is null!","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"genie-backend/src/main/java/com/jd/genie/service/VectorService.java","lineNumber":156,"sourceCode":"                    return data.getUuid();\n                }\n                return UUID.randomUUID().toString();\n            }).collect(Collectors.toList());\n            List<Map<String, Object>> payloads = vectorSaveReq.getDataList().stream().map(VectorSaveReq.VectorData::getPayloads).collect(Collectors.toList());\n            qdrantService.upsertVectorsPayloadTrans(vectorSaveReq.getCollectionName(), idList, vector, payloads);\n            return true;\n        } catch (Exception e) {\n            log.error(\"saveVector error: req:{}\", JSONObject.toJSONString(vectorSaveReq), e);\n            return false;\n        }\n    }\n\n    public Boolean deleteVector(String collectionName, List<String> vectorIdList) {\n        if (StringUtils.isBlank(collectionName)) {\n            throw new RuntimeException(\"collectionName is null!\");\n        }\n        if (CollectionUtils.isEmpty(vectorIdList)) {\n            throw new RuntimeException(\"vectorIdList is null!\");\n        }\n\n        try {\n            List<Points.PointId> pointIds = vectorIdList.stream().map(vId -> PointIdFactory.id(UUID.fromString(vId))).collect(Collectors.toList());\n            qdrantService.deletePointsSync(collectionName, pointIds);\n            return true;\n        } catch (Exception e) {\n            log.error(\"vector delete failed, collectionName:{}\", collectionName, e);\n            return false;\n        }\n    }\n\n    public Boolean deleteVector(String collectionName, Points.Filter filter) {\n        if (StringUtils.isBlank(collectionName)) {\n            throw new RuntimeException(\"collectionName is null!\");\n        }\n        if (filter == null) {\n            throw new RuntimeException(\"filter is null!\");","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/jd-opensource/joyagent-jdgenie/blob/2417e0b8b636d941ad5fb14c59b20dddfef5375d/genie-backend/src/main/java/com/jd/genie/service/VectorService.java#L138-L174","documentation":"deleteVector validates its inputs before deleting points from the Qdrant collection. If vectorIdList is null or empty (CollectionUtils.isEmpty), it fails fast with this RuntimeException instead of issuing a pointless or invalid delete call to Qdrant.","triggerScenarios":"Calling VectorService.deleteVector(collectionName, vectorIdList) with a null list or an empty list of vector IDs; also when an upstream caller passes an unpopulated ID list collected from an empty query result.","commonSituations":"Batch cleanup jobs where the ID list is built by filtering/collecting and yields zero matches; callers that never check a lookup returned no IDs before attempting deletion.","solutions":["Ensure the caller populates vectorIdList with valid UUID strings before calling deleteVector","Guard the call site: skip deletion when the list is null or empty","Log and no-op instead of throwing when an empty delete is acceptable","Pass a Qdrant Filter-based deleteVector overload if you intend a bulk delete by criteria"],"exampleFix":"// before\nvectorService.deleteVector(\"my-collection\", ids);\n// after\nif (ids != null && !ids.isEmpty()) {\n    vectorService.deleteVector(\"my-collection\", ids);\n}","handlingStrategy":"validation","validationCode":"if (vectorIdList == null || vectorIdList.isEmpty()) {\n    throw new IllegalArgumentException(\"vectorIdList must be non-empty\");\n}\nvectorIdList.forEach(id -> UUID.fromString(id)); // validate UUID format too\nvectorService.deleteVector(collectionName, vectorIdList);","typeGuard":null,"tryCatchPattern":"try {\n    vectorService.deleteVector(collectionName, vectorIdList);\n} catch (RuntimeException e) {\n    log.warn(\"vector delete skipped: {}\", e.getMessage());\n}","preventionTips":["Never call deleteVector with an empty or null ID list; skip or log instead","Validate each ID is a parseable UUID before batching the delete","Prefer the Filter-based overload for criteria-based bulk deletes","Unit-test the empty-list path of ID-collection logic"],"tags":["java","validation","qdrant","null-argument"],"backgroundTag":"null-argument","analyzedSha":"2417e0b8b636d941ad5fb14c59b20dddfef5375d","analyzedAt":"2026-09-08T11:28:19.414Z","contentChangedAt":"2026-09-08T11:28:19.414Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}