LykosAI/StabilityMatrix · warning · DataValidationException

URL is required

Error message

URL is required

What it means

In InstallExtensionManualAsync, the 'Manual Extension Install' dialog's URL field validator throws DataValidationException('URL is required') when the submitted text is null or whitespace. It is a guard ensuring a URL is present before attempting to parse or fetch it.

Solutions

  1. Enter a valid absolute extension URL (e.g. a GitHub repository URL) in the Extension URL field before confirming.
  2. If automating, ensure the text passed to the dialog validator is non-empty.

Example fix

// before
Validator = text => { if (string.IsNullOrWhiteSpace(text)) throw new DataValidationException("URL is required"); ... }
// after
Validator = text => {
    var url = text?.Trim();
    if (string.IsNullOrEmpty(url)) throw new DataValidationException("URL is required");
    if (!Uri.TryCreate(url, UriKind.Absolute, out _)) throw new DataValidationException("Invalid URL format");
}
Defensive patterns

Strategy: validation

Validate before calling

if (!string.IsNullOrWhiteSpace(urlText)) {
    // safe to open dialog / call InstallExtensionManualAsync
}

Type guard

bool HasUrl(string? s) => !string.IsNullOrWhiteSpace(s);

Try / catch

try { await viewModel.InstallExtensionManualAsync(); }
catch (DataValidationException ex) { Notify(ex.Message); }

Prevention

When it happens

Trigger: Clicking the primary (install) button of the Manual Extension Install dialog with the Extension URL field left blank or containing only whitespace.

Common situations: User opens the manual install dialog intending to paste a git URL but submits before pasting; pasting only whitespace after clearing the clipboard.

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/ac8eae75e1f90aba. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageExtensionBrowserViewModel.cs:702

    [RelayCommand]
    private void SelectAllInstalledExtensions()
    {
        foreach (var item in InstalledItemsSearchCollection.FilteredItems)
        {
            item.IsSelected = true;
        }
    }

    [RelayCommand]
    private async Task InstallExtensionManualAsync()
    {
        var textField = new TextBoxField
        {
            Label = "Extension URL",
            Validator = text =>
            {
                if (string.IsNullOrWhiteSpace(text))
                    throw new DataValidationException("URL is required");

                if (!Uri.TryCreate(text, UriKind.Absolute, out _))
                    throw new DataValidationException("Invalid URL format");
            },
        };
        var dialog = DialogHelper.CreateTextEntryDialog("Manual Extension Install", "", [textField]);

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

        var url = textField.Text.Trim();
        if (string.IsNullOrWhiteSpace(url))
            return;

        if (
            !Uri.TryCreate(url, UriKind.Absolute, out var uri)
            || !uri.Host.Equals("github.com", StringComparison.OrdinalIgnoreCase)
        )

View on GitHub (pinned to af93d6ef57)