Unity-Technologies/UnityCsReference · error · LayoutException

Invalid split view data

Error message

Invalid split view data

What it means

While deserializing a saved window layout, ParseViewData expects a split view's 'children' entry to be an IList; if it is missing or of the wrong type (null), the layout file is structurally invalid and the editor aborts parsing with LayoutException. This is a data-integrity guard against corrupted or hand-edited .wlt layout files.

Source

Thrown at Editor/Mono/GUI/WindowLayout.cs:192

                    Debug.LogWarning($"{ModeService.currentId} defines both tabs and splitter (horizontal or vertical) layouts.\n You can only define one to true (i.e. tabs = true) in the editor mode file.");

                if (useSplitter)
                {
                    var splitView = ScriptableObject.CreateInstance<SplitView>();
                    splitView.vertical = isVertical;
                    view = splitView;
                }
                else if (useTabs)
                {
                    var dockAreaView = ScriptableObject.CreateInstance<DockArea>();
                    view = dockAreaView;
                }

                view.position = new Rect(0, 0, width, height);

                var childrenData = viewInfo.extendedData["children"] as IList;
                if (childrenData == null)
                    throw new LayoutException("Invalid split view data");

                int childIndex = 0;
                foreach (var childData in childrenData)
                {
                    var lvi = new LayoutViewInfo(childIndex, useTabs ? 1f : 1f / childrenData.Count, true);
                    if (!ParseViewData(availableEditorWindowTypes, childData, ref lvi))
                        continue;

                    var cw = useTabs ? width : (isVertical ? width : width * lvi.size);
                    var ch = useTabs ? height : (isVertical ? height * lvi.size : height);
                    if (useTabs && view is DockArea da)
                    {
                        da.AddTab((EditorWindow)ScriptableObject.CreateInstance(lvi.type));
                    }
                    else
                    {
                        view.AddChild(LoadLayoutView<HostView>(availableEditorWindowTypes, lvi, cw, ch));
                        view.children[childIndex].position = new Rect(0, 0, cw, ch);

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Discard the corrupt layout file and load the default layout (Window > Layouts > Default).
  2. Restore from a known-good backup of the .wlt file (e.g. Library or user settings backup).
  3. If generating layout files programmatically, ensure every split node has a valid 'children' IList entry.
  4. After a version upgrade, let Unity migrate layouts rather than copying old files directly.
Defensive patterns

Strategy: validation

Validate before calling

// validate a parsed split node before relying on it
var childrenData = viewInfo.extendedData["children"] as IList;
if (childrenData == null)
    throw new LayoutException("Invalid split view data");

Type guard

static bool IsValidSplitNode(Dictionary<string,object> node)
    => node.TryGetValue("children", out var c) && c is IList;

Try / catch

try { EditorUtility.LoadWindowLayout(path); }
catch (LayoutException ex) when (ex.Message == "Invalid split view data")
{ /* fall back to default layout */ }

Prevention

When it happens

Trigger: Loading a .wlt file whose split-view node lacks a 'children' key or has it as a non-list type; a layout serialized by an incompatible/older Unity version; a manually edited or truncated layout file.

Common situations: Sharing layout files across Unity versions; a crash during a previous save leaving a partial layout; third-party tooling that rewrites layout JSON.

Related errors


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