EllanJiang/GameFramework · critical · GameFrameworkException

Open UI form info is invalid.

Error message

Open UI form info is invalid.

What it means

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.

Solutions

  1. Always open forms through UIComponent/UIManager.OpenUIForm so OpenUIFormInfo is created correctly
  2. Do not release or mutate pending open info externally; wait for the OpenUIFormSuccess/Failure events
  3. Guard against scene changes racing pending async opens, or cancel them via the proper API

Example fix

// before
resource.LoadAsset(assetName, typeof(GameObject), OnSuccess, myCustomData);
// after
UIComponent.OpenUIForm(assetName, groupName, userData); // framework builds OpenUIFormInfo itself
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure opens go through the public API only:
// UIComponent.OpenUIForm(...) creates OpenUIFormInfo internally; never hand-roll userData.

Try / catch

try { m_UIComponent.OpenUIForm(asset, group, userData); } catch (GameFrameworkException ex) { Log.Error("Open state corrupted: {0}", ex.Message); }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/f6c68e7d9f7a5974. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/UI/UIManager.cs:981

            {
                if (m_OpenUIFormFailureEventHandler != null)
                {
                    OpenUIFormFailureEventArgs openUIFormFailureEventArgs = OpenUIFormFailureEventArgs.Create(serialId, uiFormAssetName, uiGroup.Name, pauseCoveredUIForm, exception.ToString(), userData);
                    m_OpenUIFormFailureEventHandler(this, openUIFormFailureEventArgs);
                    ReferencePool.Release(openUIFormFailureEventArgs);
                    return;
                }

                throw;
            }
        }

        private void LoadAssetSuccessCallback(string uiFormAssetName, object uiFormAsset, float duration, object userData)
        {
            OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData;
            if (openUIFormInfo == null)
            {
                throw new GameFrameworkException("Open UI form info is invalid.");
            }

            if (m_UIFormsToReleaseOnLoad.Contains(openUIFormInfo.SerialId))
            {
                m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId);
                ReferencePool.Release(openUIFormInfo);
                m_UIFormHelper.ReleaseUIForm(uiFormAsset, null);
                return;
            }

            m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId);
            UIFormInstanceObject uiFormInstanceObject = UIFormInstanceObject.Create(uiFormAssetName, uiFormAsset, m_UIFormHelper.InstantiateUIForm(uiFormAsset), m_UIFormHelper);
            m_InstancePool.Register(uiFormInstanceObject, true);

            InternalOpenUIForm(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup, uiFormInstanceObject.Target, openUIFormInfo.PauseCoveredUIForm, true, duration, openUIFormInfo.UserData);
            ReferencePool.Release(openUIFormInfo);
        }

View on GitHub (pinned to d0c010b051)