{"record":{"id":"cd73f0c5f1180993","repo":"EllanJiang/GameFramework","slug":"ui-form-helper-is-invalid","errorCode":null,"errorMessage":"UI form helper is invalid.","messagePattern":"UI form helper is invalid\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/UI/UIManager.UIFormInstanceObject.cs","lineNumber":37,"sourceCode":"            private object m_UIFormAsset;\n            private IUIFormHelper m_UIFormHelper;\n\n            public UIFormInstanceObject()\n            {\n                m_UIFormAsset = null;\n                m_UIFormHelper = null;\n            }\n\n            public static UIFormInstanceObject Create(string name, object uiFormAsset, object uiFormInstance, IUIFormHelper uiFormHelper)\n            {\n                if (uiFormAsset == null)\n                {\n                    throw new GameFrameworkException(\"UI form asset is invalid.\");\n                }\n\n                if (uiFormHelper == null)\n                {\n                    throw new GameFrameworkException(\"UI form helper is invalid.\");\n                }\n\n                UIFormInstanceObject uiFormInstanceObject = ReferencePool.Acquire<UIFormInstanceObject>();\n                uiFormInstanceObject.Initialize(name, uiFormInstance);\n                uiFormInstanceObject.m_UIFormAsset = uiFormAsset;\n                uiFormInstanceObject.m_UIFormHelper = uiFormHelper;\n                return uiFormInstanceObject;\n            }\n\n            public override void Clear()\n            {\n                base.Clear();\n                m_UIFormAsset = null;\n                m_UIFormHelper = null;\n            }\n\n            protected internal override void Release(bool isShutdown)\n            {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/UI/UIManager.UIFormInstanceObject.cs#L19-L55","documentation":"UIManager.UIFormInstanceObject.Create throws when the uiFormHelper parameter is null. Every UI form instance needs its helper to create, release, and instantiate form assets during pooling and shutdown, so a missing helper makes the instance object unusable.","triggerScenarios":"Calling UIFormInstanceObject.Create without a valid IUIFormHelper — usually a custom helper integration that forgot to assign the helper, or the UIManager was built without a UI form helper set.","commonSituations":"Forgot to call SetUIFormHelper / register the helper component in the Unity scene; custom instantiation code constructed instance objects directly; dependency injection omitted the helper.","solutions":["Set a valid IUIFormHelper on UIManager (e.g. via UIComponent/UnityGameFramework defaults) before opening forms.","Pass the helper you configured into Create when calling it manually.","Register the UIFormHelper MonoBehaviour in the scene if using the default pipeline."],"exampleFix":"// before\nUIComponent.SetUIFormHelper(null);\n// after\nUIComponent.SetUIFormHelper(gameObject.AddComponent<UIFormHelper>());","handlingStrategy":"validation","validationCode":"if (uiFormHelper == null)\n{\n    Log.Error(\"UI form helper not configured; call SetUIFormHelper first\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try { var inst = UIFormInstanceObject.Create(name, asset, uiForm, helper); }\ncatch (GameFrameworkException ex) { Log.Error(ex, \"UI form helper missing\"); }","preventionTips":["Configure IUIFormHelper during UIComponent initialization, before any form work","Use default UnityGameFramework scene setup which wires helpers automatically","Assert helper non-null in bootstrap code"],"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-15T23:17:13.987Z"}