xpipe-io/xpipe · error · IllegalArgumentException

Name is empty

Error message

Name is empty

What it means

DataStoreEntry.createNew(uuid, categoryUuid, name, store) validates that the entry name is non-blank before creating the storage entry, because names are used as identifiers/labels in the vault UI and storage. A blank name (empty or whitespace-only) throws IllegalArgumentException.

Source

Thrown at app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java:181

                null,
                null);
    }

    public static DataStoreEntry createNew(@NonNull NameableStore store) {
        return createNew(
                UUID.randomUUID(), DataStorage.get().getSelectedCategory().getUuid(), store.getName(), store);
    }

    public static DataStoreEntry createNew(@NonNull String name, DataStore store) {
        return createNew(
                UUID.randomUUID(), DataStorage.get().getSelectedCategory().getUuid(), name, store);
    }

    @SneakyThrows
    public static DataStoreEntry createNew(
            @NonNull UUID uuid, @NonNull UUID categoryUuid, @NonNull String name, DataStore store) {
        if (name.isBlank()) {
            throw new IllegalArgumentException("Name is empty");
        }

        var storeNode = DataStoreEntryNode.of(store);
        var validity =
                store == null ? Validity.LOAD_FAILED : store.isComplete() ? Validity.COMPLETE : Validity.INCOMPLETE;
        var now = Instant.now();
        var entry = new DataStoreEntry(
                null,
                uuid,
                categoryUuid,
                name.strip(),
                now,
                now,
                now,
                true,
                validity,
                null,
                false,

View on GitHub (pinned to d85ca821ba)

Solutions

  1. Provide a non-blank name, e.g. default to a generated name when input is blank.
  2. Trim and validate user-supplied names before calling createNew.
  3. If the name comes from an import file, check the source record has a populated name field.

Example fix

// before
var entry = DataStoreEntry.createNew(uuid, catId, userInputName, store); // throws if blank
// after
String name = userInputName == null || userInputName.isBlank() ? "New store " + uuid : userInputName.trim();
var entry = DataStoreEntry.createNew(uuid, catId, name, store);
Defensive patterns

Strategy: validation

Validate before calling

if (name == null || name.isBlank()) {
    name = "Store " + UUID.randomUUID();
}

Try / catch

try {
    DataStoreEntry.createNew(uuid, catId, name, store);
} catch (IllegalArgumentException e) {
    // retry with a generated default name
}

Prevention

When it happens

Trigger: Calling DataStoreEntry.createNew(...) with name == "" or a whitespace-only string; the method is annotated @NonNull so passing null fails even earlier; typically reached from createNew overloads that generate a name from user input.

Common situations: Adding a store connection via API/script where the name field was left empty; a UI dialog bypassed or automated that did not enforce a name; import/migration code that lost the name field.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of xpipe-io/xpipe@d85ca821ba (2026-09-06). Data as JSON: /api/errors/7c0e457f7b0a2e57. Report an issue: GitHub.