Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added additional check in UpdateRowColDefinitions to avoid exception. #190

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/Components/AvalonDock/Controls/LayoutGridControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
AvalonDock

Copyright (C) 2007-2013 Xceed Software Inc.
Expand Down Expand Up @@ -209,7 +209,8 @@ private void UpdateRowColDefinitions()
{
var iColumn = 0;
var iChild = 0;
for (var iChildModel = 0; iChildModel < _model.Children.Count; iChildModel++, iColumn++, iChild++)
// BD: 24.08.2020 added check for iChild against InternalChildren.Count
for (var iChildModel = 0; iChildModel < _model.Children.Count && iChild < InternalChildren.Count; iChildModel++, iColumn++, iChild++)
{
var childModel = _model.Children[iChildModel] as ILayoutPositionableElement;
ColumnDefinitions.Add(new ColumnDefinition
Expand Down Expand Up @@ -244,7 +245,8 @@ private void UpdateRowColDefinitions()
{
var iRow = 0;
var iChild = 0;
for (var iChildModel = 0; iChildModel < _model.Children.Count; iChildModel++, iRow++, iChild++)
// BD: 24.08.2020 added check for iChild against InternalChildren.Count
for (var iChildModel = 0; iChildModel < _model.Children.Count && iChild < InternalChildren.Count; iChildModel++, iRow++, iChild++)
{
var childModel = _model.Children[iChildModel] as ILayoutPositionableElement;
RowDefinitions.Add(new RowDefinition
Expand Down