xpipe-io/xpipe · error · IllegalArgumentException
Names are null
Error message
Names are null
What it means
StorePath.create throws IllegalArgumentException when the varargs names array itself is null. StorePath models hierarchical store names, so a null array is invalid input rather than an empty path. This is a defensive API contract check.
Source
Thrown at app/src/main/java/io/xpipe/app/util/StorePath.java:40
public class StorePath {
public static final char SEPARATOR = '/';
private final List<String> names;
@JsonCreator
public StorePath(List<String> names) {
this.names = names;
}
/**
* Creates a new store path.
*
* @throws IllegalArgumentException if any name is not valid
*/
public static StorePath create(String... names) {
if (names == null) {
throw new IllegalArgumentException("Names are null");
}
if (Arrays.stream(names).anyMatch(s -> s == null)) {
throw new IllegalArgumentException("Name is null");
}
if (Arrays.stream(names).anyMatch(s -> s.contains("" + SEPARATOR))) {
throw new IllegalArgumentException("Separator character " + SEPARATOR + " is not allowed in the names");
}
if (Arrays.stream(names).anyMatch(s -> s.strip().length() == 0)) {
throw new IllegalArgumentException("Trimmed entry name is empty");
}
return new StorePath(Arrays.stream(names).toList());
}
/**View on GitHub (pinned to d85ca821ba)
Solutions
- Ensure the names array is initialized before calling create; use an empty array or default value
- Validate upstream config/data that produces the names list
- Coalesce null lists to empty arrays at the call site
Example fix
// before String[] names = config.getNames(); // may be null StorePath path = StorePath.create(names); // after String[] names = config.getNames() != null ? config.getNames() : new String[0]; StorePath path = StorePath.create(names);
Defensive patterns
Strategy: validation
Validate before calling
if (names == null) {
names = new String[0]; // or throw a meaningful domain error
}
StorePath path = StorePath.create(names); Type guard
boolean hasNames(String[] names) { return names != null; } Try / catch
try {
StorePath.create(names);
} catch (IllegalArgumentException e) {
logger.error("invalid store path input: {}", e.getMessage());
} Prevention
- Initialize name arrays with defaults instead of null
- Validate config-derived name lists at load time
- Never forward possibly-null varargs arrays
When it happens
Trigger: Calling StorePath.create((String[]) null) or passing a null String[] variable, typically from code that assembled names dynamically and ended with null.
Common situations: Building names from configuration where a list field was missing and null was forwarded; reflection or generic varargs calls passing null arrays.
Related errors
- Name is null
- Separator character ${SEPARATOR} is not allowed in the names
- Cannot delete category: " + cat.getName()
- Not a toggleable connection
- Directory is a root
AI-assisted analysis of xpipe-io/xpipe@d85ca821ba (2026-09-06).
Data as JSON: /api/errors/d293dd38024d2df1.
Report an issue: GitHub.