EllanJiang/GameFramework · error · GameFrameworkException

Update version list callbacks is invalid.

Error message

Update version list callbacks is invalid.

What it means

Thrown by ResourceManager.UpdateVersionList when the updateVersionListCallbacks parameter is null. The callbacks struct/delegate carries the handlers the framework invokes when the version list download succeeds or fails, so it is mandatory.

Solutions

  1. Construct and pass a valid UpdateVersionListCallbacks with success and failure handlers before calling UpdateVersionList.
  2. Initialize the callback members before triggering the update flow.
  3. Log/assert the callbacks are non-null in your bootstrap to fail fast.

Example fix

// before
m_ResourceComponent.UpdateVersionList(length, hashCode, cLen, cHash, null);
// after
m_ResourceComponent.UpdateVersionList(length, hashCode, cLen, cHash,
    new UpdateVersionListCallbacks(OnUpdateVersionListSuccess, OnUpdateVersionListFailure));
Defensive patterns

Strategy: validation

Validate before calling

if (updateVersionListCallbacks == null)
    throw new InvalidOperationException("updateVersionListCallbacks must be assigned before UpdateVersionList");
m_ResourceComponent.UpdateVersionList(len, hash, cLen, cHash, updateVersionListCallbacks);

Try / catch

try { m_ResourceComponent.UpdateVersionList(len, hash, cLen, cHash, callbacks); }
catch (GameFrameworkException e) { Log.Fatal("Invalid UpdateVersionList callbacks: {0}", e.Message); }

Prevention

When it happens

Trigger: Calling UpdateVersionList(length, hashCode, compressedLength, compressedHashCode, null), typically because callback fields were not assigned or a callback-building helper returned null.

Common situations: Forgetting to wire UnityEvent/delegate members for version-list success/failure callbacks; passing an uninitialized struct in custom bootstrap code.

Related errors


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

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.cs:1152

                throw new GameFrameworkException("You can not use CheckVersionList at this time.");
            }

            return m_VersionListProcessor.CheckVersionList(latestInternalResourceVersion);
        }

        /// <summary>
        /// 使用可更新模式并更新版本资源列表。
        /// </summary>
        /// <param name="versionListLength">版本资源列表大小。</param>
        /// <param name="versionListHashCode">版本资源列表哈希值。</param>
        /// <param name="versionListCompressedLength">版本资源列表压缩后大小。</param>
        /// <param name="versionListCompressedHashCode">版本资源列表压缩后哈希值。</param>
        /// <param name="updateVersionListCallbacks">版本资源列表更新回调函数集。</param>
        public void UpdateVersionList(int versionListLength, int versionListHashCode, int versionListCompressedLength, int versionListCompressedHashCode, UpdateVersionListCallbacks updateVersionListCallbacks)
        {
            if (updateVersionListCallbacks == null)
            {
                throw new GameFrameworkException("Update version list callbacks is invalid.");
            }

            if (m_ResourceMode == ResourceMode.Unspecified)
            {
                throw new GameFrameworkException("You must set resource mode first.");
            }

            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)
            {
                throw new GameFrameworkException("You can not use UpdateVersionList without updatable resource mode.");
            }

            if (m_VersionListProcessor == null)
            {
                throw new GameFrameworkException("You can not use UpdateVersionList at this time.");
            }

            m_UpdateVersionListCallbacks = updateVersionListCallbacks;

View on GitHub (pinned to d0c010b051)