{"record":{"id":"0fbed4197822a266","repo":"Unity-Technologies/UnityCsReference","slug":"failure-to-load-editor-resource-asset-bundle","errorCode":null,"errorMessage":"Failure to load editor resource asset bundle.","messagePattern":"Failure to load editor resource asset bundle\\.","errorType":"exception","errorClass":"NullReferenceException","httpStatus":null,"severity":"critical","filePath":"Editor/Mono/EditorGUIUtility.cs","lineNumber":1365,"sourceCode":"        public static UnityObject Load(string path)\n        {\n            return Load(path, typeof(UnityObject));\n        }\n\n        [TypeInferenceRule(TypeInferenceRules.TypeReferencedBySecondArgument)]\n        private static UnityObject Load(string filename, Type type)\n        {\n            var asset = EditorResources.Load(filename, type);\n            if (asset != null)\n                return asset;\n\n            AssetBundle bundle = GetEditorAssetBundle();\n            if (bundle == null)\n            {\n                // If in batch mode, loading any Editor UI items shouldn't be needed\n                if (Application.isBatchMode)\n                    return null;\n                throw new NullReferenceException(\"Failure to load editor resource asset bundle.\");\n            }\n\n            asset = bundle.LoadAsset(filename, type);\n            if (asset != null)\n            {\n                asset.hideFlags |= HideFlags.HideAndDontSave;\n                return asset;\n            }\n\n            return AssetDatabase.LoadAssetAtPath(filename, type);\n        }\n\n        public static void PingObject(UnityObject obj)\n        {\n            if (obj != null)\n                PingObject(obj.GetEntityId());\n        }\n","sourceCodeStart":1347,"sourceCodeEnd":1383,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/EditorGUIUtility.cs#L1347-L1383","documentation":"Thrown by EditorGUIUtility.Load when EditorResources.Load returns null and the editor asset bundle (GetEditorAssetBundle) is also null. The guard explicitly skips throwing in batch mode (returns null), but in the interactive editor a missing bundle is fatal because UI styles/icons cannot be resolved. The exception type is NullReferenceException to halt the editor startup.","triggerScenarios":"Editor UI bootstrap path resolving a resource (style, icon, font) before the editor asset bundle is initialized. Triggered when the bundle file is missing, corrupt, or fails to load, and the editor is not in batch mode.","commonSituations":"Corrupted Unity install (the editor resource bundle was deleted or never extracted); a custom editor build missing skin resources; antivirus quarantining the bundle; running an editor from a partial extraction of the install archive.","solutions":["Reinstall or repair the Unity editor to restore the editor asset bundle.","If running in automation/CI, prefer batch mode (-batchmode) so the missing UI bundle is tolerated.","Verify the editor install directory is complete and not partially synced.","Disable antivirus interference or add the Unity install folder to exclusions and reinstall."],"exampleFix":"// no code fix; this is an environment/install integrity issue.\n// before: launching editor interactively with missing bundle -> throws.\n// after: reinstall editor OR launch with -batchmode for headless workflows.","handlingStrategy":"fallback","validationCode":"if (Application.isBatchMode) { /* skip UI resource load */ }","typeGuard":null,"tryCatchPattern":"try { return EditorGUIUtility.Load(path, type); } catch (NullReferenceException) { return null; /* tolerate in custom tooling, report install corruption */ }","preventionTips":["Run headless workflows with -batchmode so missing UI bundles are tolerated.","Verify the Unity install integrity (resource bundle present) before launching.","Exclude the Unity install folder from antivirus quarantine."],"tags":["csharp","unity-editor","resources","asset-bundle","environment","startup"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}