Unity-Technologies/UnityCsReference · error · ArgumentException

There must be atleast 1 content tab defined for the Lighting

Error message

There must be atleast 1 content tab defined for the Lighting Explorer.

What it means

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.

Source

Thrown at Editor/Mono/SceneModeWindows/LightingExplorerWindow.cs:182

        private void UpdateTabs()
        {
            var SRPType = GetSRPType();

            if (m_CurrentLightingExplorerExtension == null || m_CurrentSRPType != SRPType)
            {
                m_CurrentSRPType = SRPType;

                OnDisableTabsAndExtension();

                m_CurrentLightingExplorerExtension = GetLightExplorerExtension(SRPType);
                m_CurrentLightingExplorerExtension.OnEnable();

                m_SelectedTab = EditorSettings.defaultBehaviorMode == EditorBehaviorMode.Mode2D ? /* 2D Lights */ 1 : /* Lights */ 0;

                if (m_CurrentLightingExplorerExtension.GetContentTabs() == null || m_CurrentLightingExplorerExtension.GetContentTabs().Length == 0)
                {
                    throw new ArgumentException("There must be atleast 1 content tab defined for the Lighting Explorer.");
                }

                m_TableTabs =  m_CurrentLightingExplorerExtension.GetContentTabs();
                m_TabTitles = m_TableTabs != null ? Array.ConvertAll(m_TableTabs, item => item.title) : null;
            }
        }

        ILightingExplorerExtension GetDefaultLightingExplorerExtension()
        {
            return s_DefaultLightingExplorerExtension ??= new DefaultLightingExplorerExtension();
        }

        ILightingExplorerExtension GetLightExplorerExtension(Type currentSRPType)
        {
            if (currentSRPType == null)
                return GetDefaultLightingExplorerExtension();

            var extensionType = RenderPipelineEditorUtility.GetDerivedTypesSupportedOnCurrentPipeline<ILightingExplorerExtension>().FirstOrDefault();

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Ensure GetContentTabs always returns a non-empty array of LightingExplorerTab.
  2. Fall back to DefaultLightingExplorerExtension tabs when your custom logic produces none.
  3. Return at least one tab with valid objects and columns functions.

Example fix

// before
public override LightingExplorerTab[] GetContentTabs()
{
    return customTabs;
}

// after
public override LightingExplorerTab[] GetContentTabs()
{
    return customTabs != null && customTabs.Length > 0
        ? customTabs
        : base.GetContentTabs();
}
Defensive patterns

Strategy: validation

Validate before calling

LightingExplorerTab[] SafeContentTabs(ILightingExplorerExtension ext)
{
    var tabs = ext?.GetContentTabs();
    return (tabs != null && tabs.Length > 0) ? tabs : new DefaultLightingExplorerExtension().GetContentTabs();
}

Prevention

When it happens

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

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

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/1fe4819145cd7369. Report an issue: GitHub.