{"record":{"id":"d6120f03cfa6c167","repo":"EllanJiang/GameFramework","slug":"can-not-find-ui-form-info-for-serial-id-0-ui-form-asset-name","errorCode":null,"errorMessage":"Can not find UI form info for serial id '{0}', UI form asset name is '{1}'.","messagePattern":"Can not find UI form info for serial id '(.+?)', UI form asset name is '(.+?)'\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/UI/UIManager.UIGroup.cs","lineNumber":345,"sourceCode":"            /// <summary>\n            /// 往界面组增加界面。\n            /// </summary>\n            /// <param name=\"uiForm\">要增加的界面。</param>\n            public void AddUIForm(IUIForm uiForm)\n            {\n                m_UIFormInfos.AddFirst(UIFormInfo.Create(uiForm));\n            }\n\n            /// <summary>\n            /// 从界面组移除界面。\n            /// </summary>\n            /// <param name=\"uiForm\">要移除的界面。</param>\n            public void RemoveUIForm(IUIForm uiForm)\n            {\n                UIFormInfo uiFormInfo = GetUIFormInfo(uiForm);\n                if (uiFormInfo == null)\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"Can not find UI form info for serial id '{0}', UI form asset name is '{1}'.\", uiForm.SerialId, uiForm.UIFormAssetName));\n                }\n\n                if (!uiFormInfo.Covered)\n                {\n                    uiFormInfo.Covered = true;\n                    uiForm.OnCover();\n                }\n\n                if (!uiFormInfo.Paused)\n                {\n                    uiFormInfo.Paused = true;\n                    uiForm.OnPause();\n                }\n\n                if (m_CachedNode != null && m_CachedNode.Value.UIForm == uiForm)\n                {\n                    m_CachedNode = m_CachedNode.Next;\n                }","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/UI/UIManager.UIGroup.cs#L327-L363","documentation":"RemoveUIForm (invoked when closing a UI form) first looks up the group's internal UIFormInfo record for the given IUIForm. If no record matches the form's serial id and asset name, it throws GameFrameworkException with both identifiers, indicating the form is not tracked by this group.","triggerScenarios":"Calling CloseUIForm with a form instance that was never opened in this group; closing a form that was already closed (double close); closing a form opened in a different UIGroup.","commonSituations":"Double-close from both a UI button and a timeout/path; caching an IUIForm reference after its form was closed; scene/group rebuilds invalidating old references.","solutions":["Check uiForm.IsValid / CloseUIForm return semantics; track open state yourself and skip closes of already-closed forms","Verify the form belongs to the expected UIGroup before closing","Null out cached IUIForm references after closing"],"exampleFix":"// before\nuiGroup.CloseUIForm(cachedForm); // may throw if already closed\n// after\nif (cachedForm != null && m_OpenFormIds.Contains(cachedForm.SerialId))\n{\n    uiGroup.CloseUIForm(cachedForm);\n    m_OpenFormIds.Remove(cachedForm.SerialId);\n}","handlingStrategy":"try-catch","validationCode":"if (uiForm == null || !m_OpenFormSerialIds.Contains(uiForm.SerialId)) return;","typeGuard":"bool IsTrackedForm(IUIForm form) => form != null && m_OpenFormSerialIds.Contains(form.SerialId);","tryCatchPattern":"try { uiGroup.CloseUIForm(uiForm); m_OpenFormSerialIds.Remove(uiForm.SerialId); } catch (GameFrameworkException ex) { Log.Warn($\"CloseUIForm skipped: {ex.Message}\"); }","preventionTips":["Track your own open-form set (by SerialId) and check before closing","Never close the same form twice; guard with a closed flag","Clear cached IUIForm references immediately after closing"],"tags":["unity","gameframework","ui","state"],"backgroundTag":"resource-not-found","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}