{"record":{"id":"1fe4819145cd7369","repo":"Unity-Technologies/UnityCsReference","slug":"there-must-be-atleast-1-content-tab-defined-for-th","errorCode":null,"errorMessage":"There must be atleast 1 content tab defined for the Lighting Explorer.","messagePattern":"There must be atleast 1 content tab defined for the Lighting Explorer\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/SceneModeWindows/LightingExplorerWindow.cs","lineNumber":182,"sourceCode":"\n        private void UpdateTabs()\n        {\n            var SRPType = GetSRPType();\n\n            if (m_CurrentLightingExplorerExtension == null || m_CurrentSRPType != SRPType)\n            {\n                m_CurrentSRPType = SRPType;\n\n                OnDisableTabsAndExtension();\n\n                m_CurrentLightingExplorerExtension = GetLightExplorerExtension(SRPType);\n                m_CurrentLightingExplorerExtension.OnEnable();\n\n                m_SelectedTab = EditorSettings.defaultBehaviorMode == EditorBehaviorMode.Mode2D ? /* 2D Lights */ 1 : /* Lights */ 0;\n\n                if (m_CurrentLightingExplorerExtension.GetContentTabs() == null || m_CurrentLightingExplorerExtension.GetContentTabs().Length == 0)\n                {\n                    throw new ArgumentException(\"There must be atleast 1 content tab defined for the Lighting Explorer.\");\n                }\n\n                m_TableTabs =  m_CurrentLightingExplorerExtension.GetContentTabs();\n                m_TabTitles = m_TableTabs != null ? Array.ConvertAll(m_TableTabs, item => item.title) : null;\n            }\n        }\n\n        ILightingExplorerExtension GetDefaultLightingExplorerExtension()\n        {\n            return s_DefaultLightingExplorerExtension ??= new DefaultLightingExplorerExtension();\n        }\n\n        ILightingExplorerExtension GetLightExplorerExtension(Type currentSRPType)\n        {\n            if (currentSRPType == null)\n                return GetDefaultLightingExplorerExtension();\n\n            var extensionType = RenderPipelineEditorUtility.GetDerivedTypesSupportedOnCurrentPipeline<ILightingExplorerExtension>().FirstOrDefault();","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/SceneModeWindows/LightingExplorerWindow.cs#L164-L200","documentation":"Thrown by LightingExplorerWindow when the active ILightingExplorerExtension's GetContentTabs returns null or an empty array. The Lighting Explorer window requires at least one tab to display content; zero tabs means there is nothing to render. This check runs during SRP type changes when the extension is re-initialized.","triggerScenarios":"A custom ILightingExplorerExtension.GetContentTabs implementation that returns null or an empty array. Extension that conditionally returns tabs but hits a code path returning nothing for the current SRP type.","commonSituations":"Overriding GetContentTabs in a custom lighting extension and forgetting to return the base tabs. Switching render pipelines at runtime triggering OnSRPChanged where the new extension returns no tabs. Extension authored for one SRP returning empty for another.","solutions":["Ensure GetContentTabs always returns a non-empty array of LightingExplorerTab.","Fall back to DefaultLightingExplorerExtension tabs when your custom logic produces none.","Return at least one tab with valid objects and columns functions."],"exampleFix":"// before\npublic override LightingExplorerTab[] GetContentTabs()\n{\n    return customTabs;\n}\n\n// after\npublic override LightingExplorerTab[] GetContentTabs()\n{\n    return customTabs != null && customTabs.Length > 0\n        ? customTabs\n        : base.GetContentTabs();\n}","handlingStrategy":"validation","validationCode":"LightingExplorerTab[] SafeContentTabs(ILightingExplorerExtension ext)\n{\n    var tabs = ext?.GetContentTabs();\n    return (tabs != null && tabs.Length > 0) ? tabs : new DefaultLightingExplorerExtension().GetContentTabs();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always return a non-empty array from GetContentTabs, falling back to base implementation.","Test custom lighting extensions across all SRP types the project supports."],"tags":["unity","lighting","editor","validation"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}