{"record":{"id":"f6c68e7d9f7a5974","repo":"EllanJiang/GameFramework","slug":"open-ui-form-info-is-invalid","errorCode":null,"errorMessage":"Open UI form info is invalid.","messagePattern":"Open UI form info is invalid\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"critical","filePath":"GameFramework/UI/UIManager.cs","lineNumber":981,"sourceCode":"            {\n                if (m_OpenUIFormFailureEventHandler != null)\n                {\n                    OpenUIFormFailureEventArgs openUIFormFailureEventArgs = OpenUIFormFailureEventArgs.Create(serialId, uiFormAssetName, uiGroup.Name, pauseCoveredUIForm, exception.ToString(), userData);\n                    m_OpenUIFormFailureEventHandler(this, openUIFormFailureEventArgs);\n                    ReferencePool.Release(openUIFormFailureEventArgs);\n                    return;\n                }\n\n                throw;\n            }\n        }\n\n        private void LoadAssetSuccessCallback(string uiFormAssetName, object uiFormAsset, float duration, object userData)\n        {\n            OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData;\n            if (openUIFormInfo == null)\n            {\n                throw new GameFrameworkException(\"Open UI form info is invalid.\");\n            }\n\n            if (m_UIFormsToReleaseOnLoad.Contains(openUIFormInfo.SerialId))\n            {\n                m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId);\n                ReferencePool.Release(openUIFormInfo);\n                m_UIFormHelper.ReleaseUIForm(uiFormAsset, null);\n                return;\n            }\n\n            m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId);\n            UIFormInstanceObject uiFormInstanceObject = UIFormInstanceObject.Create(uiFormAssetName, uiFormAsset, m_UIFormHelper.InstantiateUIForm(uiFormAsset), m_UIFormHelper);\n            m_InstancePool.Register(uiFormInstanceObject, true);\n\n            InternalOpenUIForm(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup, uiFormInstanceObject.Target, openUIFormInfo.PauseCoveredUIForm, true, duration, openUIFormInfo.UserData);\n            ReferencePool.Release(openUIFormInfo);\n        }\n","sourceCodeStart":963,"sourceCodeEnd":999,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/UI/UIManager.cs#L963-L999","documentation":"When a UI form asset finishes loading, LoadAssetSuccessCallback unpacks the OpenUIFormInfo record passed as userData. If that cast/record is null the open request state is gone and the framework throws this GameFrameworkException to surface the corrupted callback state.","triggerScenarios":"The OpenUIFormInfo userData was released, never created, or a caller invoked the internal load path with wrong userData; also possible if ReferencePool released the info before the load callback fired (e.g. someone closed/released pending opens during a shutdown).","commonSituations":"Custom code calling ResourceManager load APIs with hand-built userData instead of going through OpenUIForm; scene change destroying pending form opens while callbacks still arrive.","solutions":["Always open forms through UIComponent/UIManager.OpenUIForm so OpenUIFormInfo is created correctly","Do not release or mutate pending open info externally; wait for the OpenUIFormSuccess/Failure events","Guard against scene changes racing pending async opens, or cancel them via the proper API"],"exampleFix":"// before\nresource.LoadAsset(assetName, typeof(GameObject), OnSuccess, myCustomData);\n// after\nUIComponent.OpenUIForm(assetName, groupName, userData); // framework builds OpenUIFormInfo itself","handlingStrategy":"try-catch","validationCode":"// Ensure opens go through the public API only:\n// UIComponent.OpenUIForm(...) creates OpenUIFormInfo internally; never hand-roll userData.","typeGuard":null,"tryCatchPattern":"try { m_UIComponent.OpenUIForm(asset, group, userData); } catch (GameFrameworkException ex) { Log.Error(\"Open state corrupted: {0}\", ex.Message); }","preventionTips":["Never call ResourceManager load APIs directly for UI forms","Do not release ReferencePool objects you did not Create","Avoid scene changes while async opens are pending, or handle cancellation first"],"tags":["unity","gameframework","ui","internal-state","async"],"backgroundTag":"internal-invariant-violation","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"}