Skip to content

Commit

Permalink
Merge pull request #317 from Skaptor/master
Browse files Browse the repository at this point in the history
Aded LayoutItem null check when processing mouseMiddleClickButton
  • Loading branch information
Dirkster99 committed Dec 18, 2021
2 parents 9c64608 + 4c65cee commit f706dc7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ protected override void OnMouseEnter(MouseEventArgs e)
/// <inheritdoc />
protected override void OnMouseDown(MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Middle && LayoutItem.CloseCommand.CanExecute(null)) LayoutItem.CloseCommand.Execute(null);
if (LayoutItem != null && e.ChangedButton == MouseButton.Middle && LayoutItem.CloseCommand.CanExecute(null))
{
LayoutItem.CloseCommand.Execute(null);
}

base.OnMouseDown(e);
}

Expand Down

0 comments on commit f706dc7

Please sign in to comment.