{"record":{"id":"d6a3d682152480c1","repo":"EllanJiang/GameFramework","slug":"ui-group-helper-is-invalid","errorCode":null,"errorMessage":"UI group helper is invalid.","messagePattern":"UI group helper is invalid\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/UI/UIManager.UIGroup.cs","lineNumber":41,"sourceCode":"            private readonly GameFrameworkLinkedList<UIFormInfo> m_UIFormInfos;\n            private LinkedListNode<UIFormInfo> m_CachedNode;\n\n            /// <summary>\n            /// 初始化界面组的新实例。\n            /// </summary>\n            /// <param name=\"name\">界面组名称。</param>\n            /// <param name=\"depth\">界面组深度。</param>\n            /// <param name=\"uiGroupHelper\">界面组辅助器。</param>\n            public UIGroup(string name, int depth, IUIGroupHelper uiGroupHelper)\n            {\n                if (string.IsNullOrEmpty(name))\n                {\n                    throw new GameFrameworkException(\"UI group name is invalid.\");\n                }\n\n                if (uiGroupHelper == null)\n                {\n                    throw new GameFrameworkException(\"UI group helper is invalid.\");\n                }\n\n                m_Name = name;\n                m_Pause = false;\n                m_UIGroupHelper = uiGroupHelper;\n                m_UIFormInfos = new GameFrameworkLinkedList<UIFormInfo>();\n                m_CachedNode = null;\n                Depth = depth;\n            }\n\n            /// <summary>\n            /// 获取界面组名称。\n            /// </summary>\n            public string Name\n            {\n                get\n                {\n                    return m_Name;","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/UI/UIManager.UIGroup.cs#L23-L59","documentation":"The UIGroup constructor throws when the uiGroupHelper parameter is null. The group delegates depth sorting and form lifecycle operations to its helper, so a null helper makes the group non-functional from construction onward.","triggerScenarios":"UIGroup constructed (via UIManager.AddUIGroup) while no IUIGroupHelper was configured — UIManager's helper field was never set, or null was passed explicitly.","commonSituations":"Forgot to register the UIGroupHelper component in the Unity scene; custom bootstrap creating groups before UIComponent initialization; SetUIGroupHelper never called.","solutions":["Register/configure an IUIGroupHelper on UIComponent/UIManager before AddUIGroup (default UnityGameFramework does this via a scene component).","Pass the non-null helper instance when constructing UIGroup directly.","Verify scene setup: the helper component must exist under the UI/GameObject roots."],"exampleFix":"// before\nUIComponent.SetUIGroupHelper(null);\nUIComponent.AddUIGroup(\"Main\", 0);\n// after\nUIComponent.SetUIGroupHelper(gameObject.AddComponent<UIGroupHelper>());\nUIComponent.AddUIGroup(\"Main\", 0);","handlingStrategy":"validation","validationCode":"if (uiGroupHelper == null)\n{\n    Log.Error(\"UIGroup helper not configured before AddUIGroup\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try { UIComponent.AddUIGroup(groupName, depth); }\ncatch (GameFrameworkException ex) { Log.Error(ex, \"UI group helper missing\"); }","preventionTips":["Call SetUIGroupHelper during startup before any AddUIGroup","Include the default UIGroupHelper component in scene bootstrap","Assert helpers are set in your game's initialization sequence"],"tags":["unity","gameframework","ui","null-argument"],"backgroundTag":"null-argument","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}