From dff50cbb0c90bc8ebf6692db4b79681d090c5850 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 23 May 2021 11:30:35 +0200 Subject: [PATCH] =?UTF-8?q?Gradient=20editor=20-=20Fix=20#556=20again=20?= =?UTF-8?q?=F0=9F=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/GradientEditor/GradientEditorViewModel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Artemis.UI.Shared/Screens/GradientEditor/GradientEditorViewModel.cs b/src/Artemis.UI.Shared/Screens/GradientEditor/GradientEditorViewModel.cs index cf94d437f..9b5d2b182 100644 --- a/src/Artemis.UI.Shared/Screens/GradientEditor/GradientEditorViewModel.cs +++ b/src/Artemis.UI.Shared/Screens/GradientEditor/GradientEditorViewModel.cs @@ -85,8 +85,12 @@ namespace Artemis.UI.Shared.Screens.GradientEditor NotifyOfPropertyChange(nameof(HasMoreThanOneStop)); } - public void RemoveColorStop(ColorStopViewModel colorStopViewModel) + public void RemoveColorStop(ColorStopViewModel? colorStopViewModel) { + // Can be null when called by the view + if (colorStopViewModel == null) + return; + ColorStopViewModels.Remove(colorStopViewModel); ColorGradient.Remove(colorStopViewModel.ColorStop);