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