{"record":{"id":"c3081ceb0cf2144d","repo":"EllanJiang/GameFramework","slug":"ui-group-0-not-exists-specified-ui-form-1-2","errorCode":null,"errorMessage":"UI group '{0}' not exists specified UI form '[{1}]{2}'.","messagePattern":"UI group '(.+?)' not exists specified UI form '\\[(.+?)\\](.+?)'\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/UI/UIManager.UIGroup.cs","lineNumber":367,"sourceCode":"                {\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                }\n\n                if (!m_UIFormInfos.Remove(uiFormInfo))\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"UI group '{0}' not exists specified UI form '[{1}]{2}'.\", m_Name, uiForm.SerialId, uiForm.UIFormAssetName));\n                }\n\n                ReferencePool.Release(uiFormInfo);\n            }\n\n            /// <summary>\n            /// 激活界面。\n            /// </summary>\n            /// <param name=\"uiForm\">要激活的界面。</param>\n            /// <param name=\"userData\">用户自定义数据。</param>\n            public void RefocusUIForm(IUIForm uiForm, object userData)\n            {\n                UIFormInfo uiFormInfo = GetUIFormInfo(uiForm);\n                if (uiFormInfo == null)\n                {\n                    throw new GameFrameworkException(\"Can not find UI form info.\");\n                }\n","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/UI/UIManager.UIGroup.cs#L349-L385","documentation":"During RemoveUIForm, after locating the UIFormInfo the library removes it from the group's internal linked list. If the removal fails it throws GameFrameworkException naming the group and the form '[serialId]assetName', an internal-inconsistency signal: the info existed for lookup but not for removal.","triggerScenarios":"A form's UIFormInfo disappears from m_UIFormInfos between lookup and removal — e.g. re-entrant CloseUIForm calls on the same form from within UI lifecycle callbacks (OnClose/OnCover) or another thread.","commonSituations":"Closing the same form twice in one frame (once from a button handler, once from logic); CloseUIForm triggered inside the form's own close/cover callbacks; concurrent close calls without main-thread confinement.","solutions":["Remove duplicate/re-entrant CloseUIForm calls for the same form","Never call CloseUIForm on a form from inside its own OnClose/OnCover callbacks; defer with a flag or next-frame mechanism","Verify all UI operations stay on the main thread"],"exampleFix":"// before\nvoid OnCloseClicked()\n{\n    uiGroup.CloseUIForm(this);       // inside form callback\n    uiGroup.CloseUIForm(this);       // duplicate close\n}\n// after\nvoid OnCloseClicked()\n{\n    if (m_CloseRequested) return;\n    m_CloseRequested = true;\n    uiGroup.CloseUIForm(this);\n}","handlingStrategy":"try-catch","validationCode":"if (m_ClosingForms.Contains(uiForm.SerialId)) return; m_ClosingForms.Add(uiForm.SerialId);","typeGuard":"bool NotAlreadyClosing(int serialId) => !m_ClosingForms.Contains(serialId);","tryCatchPattern":"try { uiGroup.CloseUIForm(uiForm); } catch (GameFrameworkException ex) { Log.Error($\"UI form list inconsistency: {ex.Message}\"); }","preventionTips":["Guard against re-entrant/duplicate CloseUIForm calls with a closing set","Do not close forms from inside their own OnClose/OnCover callbacks","Keep all UI operations on the main thread"],"tags":["unity","gameframework","ui","internal-state"],"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-16T04:17:20.429Z"}