From 44691dd5a8536ffcf90c6d7953380cac63871cda Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 27 Jul 2023 20:18:05 +0200 Subject: [PATCH] Show question mark in race condition --- .../Controls/ProfileConfigurationIcon.axaml.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs index 1a8e91334..dd652f0d8 100644 --- a/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs +++ b/src/Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml.cs @@ -50,11 +50,8 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable { Dispatcher.UIThread.Post(() => { - if (ConfigurationIcon is null) - return; - - Stream? stream = ConfigurationIcon.GetIconStream(); - if (stream == null) + Stream? stream = ConfigurationIcon?.GetIconStream(); + if (stream == null || ConfigurationIcon == null) Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark}; else LoadFromBitmap(ConfigurationIcon, stream);