{"record":{"id":"c855bf7168ce2319","repo":"EllanJiang/GameFramework","slug":"path-is-invalid-debuggermanager","errorCode":null,"errorMessage":"Path is invalid.","messagePattern":"Path is invalid\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Debugger/DebuggerManager.cs","lineNumber":99,"sourceCode":"        /// 关闭并清理调试器管理器。\n        /// </summary>\n        internal override void Shutdown()\n        {\n            m_ActiveWindow = false;\n            m_DebuggerWindowRoot.Shutdown();\n        }\n\n        /// <summary>\n        /// 注册调试器窗口。\n        /// </summary>\n        /// <param name=\"path\">调试器窗口路径。</param>\n        /// <param name=\"debuggerWindow\">要注册的调试器窗口。</param>\n        /// <param name=\"args\">初始化调试器窗口参数。</param>\n        public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow, params object[] args)\n        {\n            if (string.IsNullOrEmpty(path))\n            {\n                throw new GameFrameworkException(\"Path is invalid.\");\n            }\n\n            if (debuggerWindow == null)\n            {\n                throw new GameFrameworkException(\"Debugger window is invalid.\");\n            }\n\n            m_DebuggerWindowRoot.RegisterDebuggerWindow(path, debuggerWindow);\n            debuggerWindow.Initialize(args);\n        }\n\n        /// <summary>\n        /// 解除注册调试器窗口。\n        /// </summary>\n        /// <param name=\"path\">调试器窗口路径。</param>\n        /// <returns>是否解除注册调试器窗口成功。</returns>\n        public bool UnregisterDebuggerWindow(string path)\n        {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Debugger/DebuggerManager.cs#L81-L117","documentation":"DebuggerManager.RegisterDebuggerWindow(path, window, args) throws this when the path string is null or empty before delegating to the root group. Debugger paths are the lookup keys for the window tree, so they must be non-empty. This is the first of several guards in the registration flow.","triggerScenarios":"Calling RegisterDebuggerWindow(null, window) or (\"\", window); passing a path built from an empty config entry or missing constant; constructing paths with string interpolation of unset variables.","commonSituations":"Inspector/config fields left blank; typos where the path variable is shadowed by an uninitialized field; refactoring that dropped the path argument.","solutions":["Supply a non-empty hierarchical path such as \"Common/MyWindow\".","Validate the path with string.IsNullOrEmpty before calling.","Centralize debugger path constants so they cannot be empty."],"exampleFix":"// before\ndebugger.RegisterDebuggerWindow(windowPath, new MyWindow());\n// after\nif (string.IsNullOrEmpty(windowPath)) windowPath = \"Custom/MyWindow\";\ndebugger.RegisterDebuggerWindow(windowPath, new MyWindow());","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(path)) throw new ArgumentException(\"Debugger path required\");","typeGuard":"static bool IsValidDebuggerPath(string p) => !string.IsNullOrEmpty(p);","tryCatchPattern":"try { debugger.RegisterDebuggerWindow(path, window, args); }\ncatch (GameFrameworkException ex) { Log.Error($\"Debugger window registration failed: {ex.Message}\"); }","preventionTips":["Centralize debugger window paths in constants","Validate paths sourced from config before registration","Never pass interpolated strings without checking for emptiness"],"tags":["debugger","path","validation","csharp"],"backgroundTag":"empty-required-field","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}