From c607b1a4dce62c2fdcb4b26c7656aab444c76d27 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Mon, 24 Aug 2020 12:00:53 +0100 Subject: [PATCH] prevent popup crashing when mainwindow has closed and popup still open. --- src/Avalonia.Native/WindowImplBase.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Native/WindowImplBase.cs b/src/Avalonia.Native/WindowImplBase.cs index 08c5d51ea0..da008c1e7a 100644 --- a/src/Avalonia.Native/WindowImplBase.cs +++ b/src/Avalonia.Native/WindowImplBase.cs @@ -94,8 +94,13 @@ namespace Avalonia.Native { get { - var s = _native.GetClientSize(); - return new Size(s.Width, s.Height); + if (_native != null) + { + var s = _native.GetClientSize(); + return new Size(s.Width, s.Height); + } + + return default; } }