{"record":{"id":"98e1a37ca034ed57","repo":"xpipe-io/xpipe","slug":"name-is-null","errorCode":null,"errorMessage":"Name is null","messagePattern":"Name is null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/util/StorePath.java","lineNumber":44,"sourceCode":"    private final List<String> names;\n\n    @JsonCreator\n    public StorePath(List<String> names) {\n        this.names = names;\n    }\n\n    /**\n     * Creates a new store path.\n     *\n     * @throws IllegalArgumentException if any name is not valid\n     */\n    public static StorePath create(String... names) {\n        if (names == null) {\n            throw new IllegalArgumentException(\"Names are null\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s == null)) {\n            throw new IllegalArgumentException(\"Name is null\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s.contains(\"\" + SEPARATOR))) {\n            throw new IllegalArgumentException(\"Separator character \" + SEPARATOR + \" is not allowed in the names\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s.strip().length() == 0)) {\n            throw new IllegalArgumentException(\"Trimmed entry name is empty\");\n        }\n\n        return new StorePath(Arrays.stream(names).toList());\n    }\n\n    /**\n     * Creates a new store path from a string representation.\n     *\n     * @param s the string representation, must be not null and fulfill certain requirements\n     * @throws IllegalArgumentException if the string is not valid","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/util/StorePath.java#L26-L62","documentation":"Generic argument-validation guard in the StorePath.create factory: it fires when any element of the supplied names vararg array is null. Store paths must consist entirely of valid, non-null name segments, so a null entry cannot be turned into a path; the caller must pass only non-null names (the array itself being null is caught separately by the preceding 'Names are null' check).","triggerScenarios":"Passing a names array containing one or more null elements, e.g. new String[]{\"group\", null} or a list converted with toArray where an entry was absent.","commonSituations":"Optional name fields left null in store configuration; joining multiple sources of name parts where one part is missing.","solutions":["Filter or default null entries before calling create: Arrays.stream(parts).filter(Objects::nonNull)","Make optional name fields explicit (empty string is also rejected; use a real default)","Validate the names list at config load time"],"exampleFix":"// before\nStorePath.create(\"stores\", maybeNullName);\n// after\nStorePath.create(Stream.of(\"stores\", maybeNullName).filter(Objects::nonNull).toArray(String[]::new));","handlingStrategy":"validation","validationCode":"List<String> safe = Arrays.stream(parts).filter(Objects::nonNull).collect(Collectors.toList());\nif (safe.isEmpty()) throw new IllegalArgumentException(\"no names provided\");\nStorePath.create(safe.toArray(new String[0]));","typeGuard":"boolean allNonNull(String[] names) { return names != null && Arrays.stream(names).allMatch(Objects::nonNull); }","tryCatchPattern":"try {\n    StorePath.create(parts);\n} catch (IllegalArgumentException e) {\n    logger.error(\"null name in store path: {}\", e.getMessage());\n}","preventionTips":["Filter null entries before building paths","Give optional name fields explicit defaults","Validate names where they are assembled, not at the API boundary"],"tags":["validation","null","argument"],"backgroundTag":"null-argument","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}