Skip to content

Commit

Permalink
Merge pull request #241 from Khaos66/master
Browse files Browse the repository at this point in the history
Fixed NullReferenceException when Root is null
  • Loading branch information
Dirkster99 committed Feb 22, 2021
2 parents 30c9cec + f990b60 commit 2705d5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public LayoutAnchorable Model
protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e)
{
if (Model != null)
SetLayoutItem(Model.Root.Manager.GetLayoutItemFromModel(Model));
SetLayoutItem(Model?.Root?.Manager?.GetLayoutItemFromModel(Model));
else
SetLayoutItem(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e)
if (Model != null)
{
Model.PropertyChanged += Model_PropertyChanged;
SetLayoutItem(Model.Root.Manager.GetLayoutItemFromModel(Model));
SetLayoutItem(Model?.Root?.Manager?.GetLayoutItemFromModel(Model));
}
else
SetLayoutItem(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e)
if (Model != null)
{
Model.PropertyChanged += Model_PropertyChanged;
SetLayoutItem(Model.Root.Manager.GetLayoutItemFromModel(Model));
SetLayoutItem(Model?.Root?.Manager?.GetLayoutItemFromModel(Model));
}
else
SetLayoutItem(null);
Expand Down

0 comments on commit 2705d5a

Please sign in to comment.