LykosAI/StabilityMatrix · warning · DataValidationException

Height is required

Error message

Height is required

What it means

This DataValidationException is thrown by the Height field's Validator in the 'Add Favorite Dimensions' dialog when the field is left blank or contains only whitespace. The dialog requires an explicit height value before the entry can be saved.

Solutions

  1. Type a height value (e.g. 1024) in the Height field
  2. If you meant a square image, enter the same value as Width
Defensive patterns

Strategy: validation

Validate before calling

bool heightPresent = !string.IsNullOrWhiteSpace(heightText);

Try / catch

try { dialog.SaveDimensions(); } catch (DataValidationException) { FocusField("Height"); ShowMessage("Height is required"); }

Prevention

When it happens

Trigger: User clicks OK/confirm in the AddRow dialog with the Height field empty or containing only spaces.

Common situations: Filling in only Width and tabbing past Height, expecting a default height to be assumed.

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 LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/ea9e3a18949e99b1. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/ViewModels/Settings/InferenceSettingsViewModel.cs:311

            {
                Label = "Width",
                Validator = text =>
                {
                    if (string.IsNullOrWhiteSpace(text))
                        throw new DataValidationException("Width is required");

                    if (!int.TryParse(text, out var width) || width <= 0)
                        throw new DataValidationException("Width must be a positive integer");
                },
                Watermark = "1024",
            },
            new()
            {
                Label = "Height",
                Validator = text =>
                {
                    if (string.IsNullOrWhiteSpace(text))
                        throw new DataValidationException("Height is required");

                    if (!int.TryParse(text, out var height) || height <= 0)
                        throw new DataValidationException("Height must be a positive integer");
                },
                Watermark = "1024",
            },
        };

        var dialog = DialogHelper.CreateTextEntryDialog("Add Favorite Dimensions", "", textFields);

        if (await dialog.ShowAsync() != ContentDialogResult.Primary)
            return;

        var width = textFields[0].Text;
        var height = textFields[1].Text;

        if (string.IsNullOrWhiteSpace(width) || string.IsNullOrWhiteSpace(height))
            return;

View on GitHub (pinned to af93d6ef57)