{"record":{"id":"ac5f8f638d395b4f","repo":"xpipe-io/xpipe","slug":"valuemustnotbeempty-ac5f8f","errorCode":null,"errorMessage":"valueMustNotBeEmpty","messagePattern":"valueMustNotBeEmpty","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStore.java","lineNumber":127,"sourceCode":"        return ShellScript.of(content);\n    }\n\n    @Override\n    public List<DataStoreEntryRef<?>> getDependencies() {\n        var l = DataStoreDependencies.of(scripts);\n        if (textSource != null) {\n            l.addAll(textSource.getDependencies());\n        }\n        return l;\n    }\n\n    @Override\n    public void checkComplete() throws Throwable {\n        if (textSource != null) {\n            textSource.checkComplete();\n        }\n        if (!initScript && !shellScript && !fileScript && !runnableScript) {\n            throw new ValidationException(AppI18n.get(\"valueMustNotBeEmpty\"));\n        }\n        if (scripts != null) {\n            Validators.contentNonNull(scripts);\n            for (DataStoreEntryRef<ScriptStore> script : scripts) {\n                Validators.nonNull(script);\n                Validators.isType(script, ScriptStore.class);\n            }\n        }\n    }\n\n    public void queryFlattenedScripts(LinkedHashSet<DataStoreEntryRef<ScriptStore>> all) {\n        DataStoreEntryRef<ScriptStore> ref = getSelfEntry().ref();\n        var added = all.add(ref);\n        // Prevent loop\n        if (added) {\n            getEffectiveScripts().stream()\n                    .filter(scriptStoreDataStoreEntryRef -> !all.contains(scriptStoreDataStoreEntryRef))\n                    .forEach(scriptStoreDataStoreEntryRef -> {","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStore.java#L109-L145","documentation":"ScriptStore.checkComplete() enforces that a script store actually contains something. After delegating to the text source, it throws ValidationException(AppI18n.get(\"valueMustNotBeEmpty\")) when none of initScript, shellScript, fileScript, or runnableScript are set — i.e. the store is empty and defines no script content of any kind.","triggerScenarios":"Saving/validating a ScriptStore with all four content modes null/false: no init script, no shell script content, no script file, and not marked runnable.","commonSituations":"User creates a script entry but never types content or picks a file; a store whose textSource was cleared in an editor; importing/pasting a store definition that lost its content.","solutions":["Set one of the script content modes: provide shell script text, a script file, mark it as an init script, or make it runnable","Delete the empty script store if it is not needed","Ensure the textSource content was actually persisted before saving"],"exampleFix":"// before\nvar store = new ScriptStore(null, null, false, false, false, false, null);\n// after\nvar store = new ScriptStore(null, textSource, false, false, false, true, null); // runnable script with content","handlingStrategy":"validation","validationCode":"boolean hasContent = initScript || shellScript || fileScript || runnableScript;\nif (!hasContent) { /* require content before saving the ScriptStore */ }","typeGuard":null,"tryCatchPattern":"try { store.checkComplete(); }\ncatch (ValidationException e) { /* treat as empty script: prompt user for content */ }","preventionTips":["Never create a script store without entering content or a file","Validate before persisting stores"],"tags":["validation","empty-value","script-store"],"backgroundTag":"empty-required-field","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}