From 3830e8566eda3329f2fa22557aeb0bc395b8d2b0 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Mon, 24 Jul 2023 16:43:00 +0100 Subject: [PATCH] Fix race condition when opening window that causes a crash --- .../Controls/ProfileConfigurationIcon.axaml.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs index 9ad64cbf8..1a8e91334 100644 --- a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs +++ b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs @@ -50,6 +50,9 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable { Dispatcher.UIThread.Post(() => { + if (ConfigurationIcon is null) + return; + Stream? stream = ConfigurationIcon.GetIconStream(); if (stream == null) Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark};