diff --git a/src/Views/Repository.axaml.cs b/src/Views/Repository.axaml.cs index 012eca75..28c493a4 100644 --- a/src/Views/Repository.axaml.cs +++ b/src/Views/Repository.axaml.cs @@ -376,7 +376,7 @@ namespace SourceGit.Views return; var grid = sender as Grid; - if (grid == null) + if (grid == null || !grid.IsAttachedToVisualTree()) return; var leftHeight = grid.Bounds.Height - 28.0 * 5;