{"record":{"id":"ea9e3a18949e99b1","repo":"LykosAI/StabilityMatrix","slug":"height-is-required","errorCode":null,"errorMessage":"Height is required","messagePattern":"Height is required","errorType":"validation","errorClass":"DataValidationException","httpStatus":null,"severity":"warning","filePath":"StabilityMatrix.Avalonia/ViewModels/Settings/InferenceSettingsViewModel.cs","lineNumber":311,"sourceCode":"            {\n                Label = \"Width\",\n                Validator = text =>\n                {\n                    if (string.IsNullOrWhiteSpace(text))\n                        throw new DataValidationException(\"Width is required\");\n\n                    if (!int.TryParse(text, out var width) || width <= 0)\n                        throw new DataValidationException(\"Width must be a positive integer\");\n                },\n                Watermark = \"1024\",\n            },\n            new()\n            {\n                Label = \"Height\",\n                Validator = text =>\n                {\n                    if (string.IsNullOrWhiteSpace(text))\n                        throw new DataValidationException(\"Height is required\");\n\n                    if (!int.TryParse(text, out var height) || height <= 0)\n                        throw new DataValidationException(\"Height must be a positive integer\");\n                },\n                Watermark = \"1024\",\n            },\n        };\n\n        var dialog = DialogHelper.CreateTextEntryDialog(\"Add Favorite Dimensions\", \"\", textFields);\n\n        if (await dialog.ShowAsync() != ContentDialogResult.Primary)\n            return;\n\n        var width = textFields[0].Text;\n        var height = textFields[1].Text;\n\n        if (string.IsNullOrWhiteSpace(width) || string.IsNullOrWhiteSpace(height))\n            return;","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/Settings/InferenceSettingsViewModel.cs#L293-L329","documentation":"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.","triggerScenarios":"User clicks OK/confirm in the AddRow dialog with the Height field empty or containing only spaces.","commonSituations":"Filling in only Width and tabbing past Height, expecting a default height to be assumed.","solutions":["Type a height value (e.g. 1024) in the Height field","If you meant a square image, enter the same value as Width"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bool heightPresent = !string.IsNullOrWhiteSpace(heightText);","typeGuard":null,"tryCatchPattern":"try { dialog.SaveDimensions(); } catch (DataValidationException) { FocusField(\"Height\"); ShowMessage(\"Height is required\"); }","preventionTips":["Never leave Height blank when adding favorite dimensions","Enter the same value as Width for square images","Check both fields before confirming the dialog"],"tags":["validation","user-input","required-field","csharp"],"backgroundTag":"empty-required-field","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}