Skip to content

Commit

Permalink
Fix NullReferenceException on _model & _model.SelectedContent in Layo…
Browse files Browse the repository at this point in the history
…utAnchorablePaneControl
  • Loading branch information
Dirkster99 committed Oct 5, 2019
1 parent deab478 commit fdc7f6a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ public ILayoutElement Model

protected override void OnGotKeyboardFocus( System.Windows.Input.KeyboardFocusChangedEventArgs e )
{
_model.SelectedContent.IsActive = true;
if( ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true;
}

base.OnGotKeyboardFocus( e );
}
Expand All @@ -79,15 +82,15 @@ protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonE
{
base.OnMouseLeftButtonDown( e );

if( !e.Handled && _model.SelectedContent != null )
if( !e.Handled && (_model != null) && _model.SelectedContent != null )
_model.SelectedContent.IsActive = true;
}

protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButtonEventArgs e )
{
base.OnMouseRightButtonDown( e );

if( !e.Handled && _model.SelectedContent != null )
if( !e.Handled && (_model != null) && _model.SelectedContent != null )
_model.SelectedContent.IsActive = true;

}
Expand Down

0 comments on commit fdc7f6a

Please sign in to comment.