2
Vote

Build 2.0.1370 - Crash setting layoutdocument side by side

description

When i try to use the "New Vertical Tab Group" or "New Horizontal Tab Group" context menu option to put the LayoutDocument Tab side by side i got the following errors:
 

LayoutGroup.cs

@Line 62 --> Crash because element is null
Proposed changed:
 
if (element !=null && element.Parent != this)

file attachments

comments

SlickRick wrote Aug 22, 2012 at 10:16 PM

To fix my bug i've replace:
            LayoutElement.IsActive = true;
            LayoutElement.Root.CollectGarbage();
with
       if (LayoutElement != null)
        {
            LayoutElement.IsActive = true;
            LayoutElement.Root.CollectGarbage();
        }

in LayoutItem.cs at line 871 (ExecuteNewVerticalTabGroupCommand method)
and at line 941 (ExecuteNewHorizontalTabGroupCommand method)

it might not be the best fix, but it works

SlickRick wrote Aug 22, 2012 at 10:23 PM

actually i needed to add also:
if (LayoutElement != null)
        { parentDocumentGroup.InsertChildAt(indexOfParentPane + 1, new LayoutDocumentPane(LayoutElement)); }