{"record":{"id":"3e8d89ab5b334f61","repo":"xpipe-io/xpipe","slug":"valuemustnotbeempty","errorCode":null,"errorMessage":"valueMustNotBeEmpty","messagePattern":"valueMustNotBeEmpty","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/util/Validators.java","lineNumber":34,"sourceCode":"                || !c.isAssignableFrom(ref.getStore().getClass())) {\n            throw new ValidationException(\"Value must be an instance of \" + c.getSimpleName());\n        }\n    }\n\n    public static <T extends DataStore> void isAnyType(DataStoreEntryRef<? extends T> ref, Class<?>... cs)\n            throws ValidationException {\n        if (ref == null\n                || ref.getStore() == null\n                || Arrays.stream(cs)\n                        .noneMatch(c -> c.isAssignableFrom(ref.getStore().getClass()))) {\n            throw new ValidationException(\"Value must be an instance of \"\n                    + Arrays.stream(cs).map(Class::getSimpleName).toList());\n        }\n    }\n\n    public static void nonNull(Object object) throws ValidationException {\n        if (object == null) {\n            throw new ValidationException(AppI18n.get(\"valueMustNotBeEmpty\"));\n        }\n    }\n\n    public static void nonNull(Object object, String name) throws ValidationException {\n        if (object == null) {\n            throw new ValidationException(AppI18n.get(\"mustNotBeEmpty\", name));\n        }\n    }\n\n    public static void contentNonNull(List<?> object) throws ValidationException {\n        if (object.stream().anyMatch(o -> o == null)) {\n            throw new ValidationException(AppI18n.get(\"valueMustNotBeEmpty\"));\n        }\n    }\n\n    public static void notEmpty(String string) throws ValidationException {\n        if (string.strip().length() == 0) {\n            throw new ValidationException(AppI18n.get(\"valueMustNotBeEmpty\"));","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/util/Validators.java#L16-L52","documentation":"Validators.nonNull(Object) throws a ValidationException with the localized i18n key \"valueMustNotBeEmpty\" when the object is null. It is a generic null check for option/config values used throughout the app's validation pipeline.","triggerScenarios":"Validators.nonNull(x) where x is null — typically an unset configuration field or a lookup that returned null being validated.","commonSituations":"Required form fields left empty; optional config entries missing at validation time; API data that unexpectedly lacked a value.","solutions":["Initialize the field or provide a default value before validation runs.","Call the overload nonNull(object, name) to get a clearer message naming the field.","Skip validation or substitute a sensible default when the value is legitimately optional."],"exampleFix":"// before\nValidators.nonNull(config.getTarget());\n// after\nif (config.getTarget() == null) {\n    config.setDefaultTarget();\n}\nValidators.nonNull(config.getTarget(), \"target\");","handlingStrategy":"validation","validationCode":"if (value != null) {\n    Validators.nonNull(value);\n}","typeGuard":"public static boolean present(Object o) {\n    return o != null;\n}","tryCatchPattern":"try {\n    Validators.nonNull(value);\n} catch (ValidationException e) {\n    // required value missing\n}","preventionTips":["Mark required fields as required in UI/config schemas","Provide defaults for commonly unset values","Prefer the nonNull(value, name) overload for clearer errors"],"tags":["java","validation","null-check","i18n"],"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"}