{"record":{"id":"9526db649cd76bee","repo":"EllanJiang/GameFramework","slug":"update-version-list-callbacks-is-invalid","errorCode":null,"errorMessage":"Update version list callbacks is invalid.","messagePattern":"Update version list callbacks is invalid\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1152,"sourceCode":"                throw new GameFrameworkException(\"You can not use CheckVersionList at this time.\");\n            }\n\n            return m_VersionListProcessor.CheckVersionList(latestInternalResourceVersion);\n        }\n\n        /// <summary>\n        /// 使用可更新模式并更新版本资源列表。\n        /// </summary>\n        /// <param name=\"versionListLength\">版本资源列表大小。</param>\n        /// <param name=\"versionListHashCode\">版本资源列表哈希值。</param>\n        /// <param name=\"versionListCompressedLength\">版本资源列表压缩后大小。</param>\n        /// <param name=\"versionListCompressedHashCode\">版本资源列表压缩后哈希值。</param>\n        /// <param name=\"updateVersionListCallbacks\">版本资源列表更新回调函数集。</param>\n        public void UpdateVersionList(int versionListLength, int versionListHashCode, int versionListCompressedLength, int versionListCompressedHashCode, UpdateVersionListCallbacks updateVersionListCallbacks)\n        {\n            if (updateVersionListCallbacks == null)\n            {\n                throw new GameFrameworkException(\"Update version list callbacks is invalid.\");\n            }\n\n            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateVersionList without updatable resource mode.\");\n            }\n\n            if (m_VersionListProcessor == null)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateVersionList at this time.\");\n            }\n\n            m_UpdateVersionListCallbacks = updateVersionListCallbacks;","sourceCodeStart":1134,"sourceCodeEnd":1170,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1134-L1170","documentation":"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.","triggerScenarios":"Calling UpdateVersionList(length, hashCode, compressedLength, compressedHashCode, null), typically because callback fields were not assigned or a callback-building helper returned null.","commonSituations":"Forgetting to wire UnityEvent/delegate members for version-list success/failure callbacks; passing an uninitialized struct in custom bootstrap code.","solutions":["Construct and pass a valid UpdateVersionListCallbacks with success and failure handlers before calling UpdateVersionList.","Initialize the callback members before triggering the update flow.","Log/assert the callbacks are non-null in your bootstrap to fail fast."],"exampleFix":"// before\nm_ResourceComponent.UpdateVersionList(length, hashCode, cLen, cHash, null);\n// after\nm_ResourceComponent.UpdateVersionList(length, hashCode, cLen, cHash,\n    new UpdateVersionListCallbacks(OnUpdateVersionListSuccess, OnUpdateVersionListFailure));","handlingStrategy":"validation","validationCode":"if (updateVersionListCallbacks == null)\n    throw new InvalidOperationException(\"updateVersionListCallbacks must be assigned before UpdateVersionList\");\nm_ResourceComponent.UpdateVersionList(len, hash, cLen, cHash, updateVersionListCallbacks);","typeGuard":null,"tryCatchPattern":"try { m_ResourceComponent.UpdateVersionList(len, hash, cLen, cHash, callbacks); }\ncatch (GameFrameworkException e) { Log.Fatal(\"Invalid UpdateVersionList callbacks: {0}\", e.Message); }","preventionTips":["Assign success/failure callback handlers before starting the update flow.","Assert callbacks non-null in bootstrap code.","Wire Unity callbacks in Awake/OnEnable, not lazily."],"tags":["unity","gameframework","resource-manager","null-argument","callbacks"],"backgroundTag":"null-argument","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"}