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; } }