JosefNemec/Playnite · error · Exception

No URL was given.

Error message

No URL was given.

What it means

Thrown by NavigateUrl(string) when the resolved url is null or empty after IsNullOrEmpty check. The command requires a non-empty target before it can process template tokens (e.g. {DocsRootUrl}) and launch the browser, so an empty value is rejected up front.

Source

Thrown at source/Playnite/Commands/GlobalCommands.cs:84

            else if (url is Link linkUrl)
            {
                NavigateUrl(linkUrl.Url);
            }
            else if (url is Uri uriUrl)
            {
                NavigateUrl(uriUrl.OriginalString);
            }
            else
            {
                throw new Exception("Unsupported URL format.");
            }
        }

        public static void NavigateUrl(string url)
        {
            if (url.IsNullOrEmpty())
            {
                throw new Exception("No URL was given.");
            }

            if (url.StartsWith("{DocsRootUrl}", StringComparison.OrdinalIgnoreCase))
            {
                url = Url.Combine(PlayniteEnvironment.DocsRootUrl, url.Replace("{DocsRootUrl}", ""));
            }

            url = url.Replace("{AppBranch}", PlayniteEnvironment.AppBranch);
            if (!Regex.IsMatch(url, @"^.*:\/\/"))
            {
                if (Paths.IsFullPath(url))
                {
                    // Do nothing, some people put local file paths to link fields: #2562
                }
                else
                {
                    url = "http://" + url;
                }

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Check !url.IsNullOrEmpty() before calling NavigateUrl and skip if empty.
  2. Validate Link objects have a non-empty Url before they reach the command.
  3. Clean imported data to remove or default empty-URL link entries.

Example fix

// before
Commands.NavigateUrl(link.Url);

// after
if (!link.Url.IsNullOrEmpty())
{
    Commands.NavigateUrl(link.Url);
}
Defensive patterns

Strategy: validation

Validate before calling

if (!url.IsNullOrEmpty())
{
    Commands.NavigateUrl(url);
}

Try / catch

try { Commands.NavigateUrl(url); }
catch (Exception e) when (e.Message.Contains("No URL was given"))
{ logger.Warn("Empty URL ignored."); }

Prevention

When it happens

Trigger: Calling NavigateUrl with an empty string, null, or a value that resolves to empty (e.g. a Link.Url that was empty forwarded from the dispatcher).

Common situations: A game/​link has a blank Url field; a command binding passes an unbound/​empty property; string interpolation produced empty; a data import created link entries with no URL.

Related errors


AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13). Data as JSON: /api/errors/50ba89d2c669eccc. Report an issue: GitHub.