From 102b1b351bce7a75be28c51ac70e19d50f786126 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 15 Dec 2022 14:17:19 +0100 Subject: [PATCH] Add null check, Customer was seeing a crash in this method, don't have a repro but other uses of `_parent` are surrounded by a null check so this makes sense I think. --- native/Avalonia.Native/src/OSX/AvnWindow.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/Avalonia.Native/src/OSX/AvnWindow.mm b/native/Avalonia.Native/src/OSX/AvnWindow.mm index 6611dcc73f..42c500716c 100644 --- a/native/Avalonia.Native/src/OSX/AvnWindow.mm +++ b/native/Avalonia.Native/src/OSX/AvnWindow.mm @@ -281,6 +281,9 @@ - (void)windowDidBecomeKey:(NSNotification *_Nonnull)notification { + if (_parent == nullptr) + return; + _parent->BringToFront(); dispatch_async(dispatch_get_main_queue(), ^{