{"record":{"id":"50ba89d2c669eccc","repo":"JosefNemec/Playnite","slug":"no-url-was-given","errorCode":null,"errorMessage":"No URL was given.","messagePattern":"No URL was given\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/Playnite/Commands/GlobalCommands.cs","lineNumber":84,"sourceCode":"            else if (url is Link linkUrl)\r\n            {\r\n                NavigateUrl(linkUrl.Url);\r\n            }\r\n            else if (url is Uri uriUrl)\r\n            {\r\n                NavigateUrl(uriUrl.OriginalString);\r\n            }\r\n            else\r\n            {\r\n                throw new Exception(\"Unsupported URL format.\");\r\n            }\r\n        }\r\n\r\n        public static void NavigateUrl(string url)\r\n        {\r\n            if (url.IsNullOrEmpty())\r\n            {\r\n                throw new Exception(\"No URL was given.\");\r\n            }\r\n\r\n            if (url.StartsWith(\"{DocsRootUrl}\", StringComparison.OrdinalIgnoreCase))\r\n            {\r\n                url = Url.Combine(PlayniteEnvironment.DocsRootUrl, url.Replace(\"{DocsRootUrl}\", \"\"));\r\n            }\r\n\r\n            url = url.Replace(\"{AppBranch}\", PlayniteEnvironment.AppBranch);\r\n            if (!Regex.IsMatch(url, @\"^.*:\\/\\/\"))\r\n            {\r\n                if (Paths.IsFullPath(url))\r\n                {\r\n                    // Do nothing, some people put local file paths to link fields: #2562\r\n                }\r\n                else\r\n                {\r\n                    url = \"http://\" + url;\r\n                }\r","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Playnite/Commands/GlobalCommands.cs#L66-L102","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check !url.IsNullOrEmpty() before calling NavigateUrl and skip if empty.","Validate Link objects have a non-empty Url before they reach the command.","Clean imported data to remove or default empty-URL link entries."],"exampleFix":"// before\nCommands.NavigateUrl(link.Url);\n\n// after\nif (!link.Url.IsNullOrEmpty())\n{\n    Commands.NavigateUrl(link.Url);\n}","handlingStrategy":"validation","validationCode":"if (!url.IsNullOrEmpty())\n{\n    Commands.NavigateUrl(url);\n}","typeGuard":null,"tryCatchPattern":"try { Commands.NavigateUrl(url); }\ncatch (Exception e) when (e.Message.Contains(\"No URL was given\"))\n{ logger.Warn(\"Empty URL ignored.\"); }","preventionTips":["Guard NavigateUrl(string) with an IsNullOrEmpty check.","Filter out Link entries with empty Url before dispatch.","Validate imported data so blank URLs never reach commands."],"tags":["url","validation","commands","playnite"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}