{"record":{"id":"0656004a53a54340","repo":"Devolutions/UniGetUI","slug":"the-path-parameter-is-required","errorCode":null,"errorMessage":"The path parameter is required.","messagePattern":"The path parameter is required\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcDesktopShortcutsApi.cs","lineNumber":129,"sourceCode":"                : System.IO.Path.GetFileNameWithoutExtension(fileName),\n            Status = DesktopShortcutsDatabase.GetStatus(shortcutPath) switch\n            {\n                DesktopShortcutsDatabase.Status.Delete => \"delete\",\n                DesktopShortcutsDatabase.Status.Maintain => \"keep\",\n                _ => \"unknown\",\n            },\n            ExistsOnDisk = File.Exists(shortcutPath),\n            IsTracked = trackedShortcuts.ContainsKey(shortcutPath),\n            IsPendingReview = DesktopShortcutsDatabase.GetUnknownShortcuts().Contains(shortcutPath),\n        };\n    }\n\n    private static string NormalizeShortcutPath(string shortcutPath)\n    {\n        string normalizedPath = shortcutPath.Trim().Trim('\"').Trim('\\'');\n        if (string.IsNullOrWhiteSpace(normalizedPath))\n        {\n            throw new InvalidOperationException(\"The path parameter is required.\");\n        }\n\n        return normalizedPath;\n    }\n}\n","sourceCodeStart":111,"sourceCodeEnd":135,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcDesktopShortcutsApi.cs#L111-L135","documentation":"Thrown by IpcDesktopShortcutsApi.NormalizeShortcutPath when, after trimming whitespace and surrounding quotes/apostrophes, the path is empty. NormalizeShortcutPath is the shared guard for SetShortcut and ResetShortcut, so both endpoints reject a blank path.","triggerScenarios":"Calling set-desktop-shortcut or reset-desktop-shortcut with a Path that is empty, only whitespace, or only quote characters. The normalizer strips \\\\\", \\\\', and whitespace before the emptiness check.","commonSituations":"Omitting the path field in the JSON body. Passing a value that consisted only of stray quotes from a shell. A templating bug producing an empty path.","solutions":["Provide the full shortcut file path in the Path field.","If building the body programmatically, assert the path is non-empty before sending.","Ensure shell quoting does not collapse the path to empty quotes."],"exampleFix":"// before\n{ \"path\": \"\\\"\\\"\", \"status\": \"delete\" }\n// after\n{ \"path\": \"C:/Users/me/Desktop/App.lnk\", \"status\": \"delete\" }","handlingStrategy":"validation","validationCode":"static bool HasShortcutPath(string? p)\n{\n    var norm = p?.Trim().Trim('\"').Trim('\\'').Trim();\n    return !string.IsNullOrWhiteSpace(norm);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require a non-empty path in the request DTO via a model validator.","Guard shell-quoting helpers that may collapse values to quotes."],"tags":["ipc","desktop-shortcuts","input-validation","missing-argument"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}