Skip to content

Commit

Permalink
Fix crash when resizing the sidebar too quickly (#4998)
Browse files Browse the repository at this point in the history
  • Loading branch information
winston-de authored May 23, 2021
1 parent 3980e79 commit b22c0aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Files/UserControls/SidebarControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ private void Border_PointerExited(object sender, PointerRoutedEventArgs e)

private void IncrementSize(double val)
{
AppSettings.SidebarWidth = new GridLength(AppSettings.SidebarWidth.Value + val);
var newSize = AppSettings.SidebarWidth.Value + val;
AppSettings.SidebarWidth = new GridLength(newSize >= 0 ? newSize : 0); // passing a negative value will cause an exception
}

private void Border_PointerEntered(object sender, PointerRoutedEventArgs e)
Expand Down

0 comments on commit b22c0aa

Please sign in to comment.