From 7c3812c529eaa02c21fce417b802832257af2f25 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 24 May 2016 13:33:24 +0200 Subject: [PATCH] Fixed a NPE while disposing the StepLabelContainer --- Greenshot/Drawing/StepLabelContainer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Greenshot/Drawing/StepLabelContainer.cs b/Greenshot/Drawing/StepLabelContainer.cs index 386a23787..08f6fbd01 100644 --- a/Greenshot/Drawing/StepLabelContainer.cs +++ b/Greenshot/Drawing/StepLabelContainer.cs @@ -148,7 +148,10 @@ namespace Greenshot.Drawing { if (!disposing) { return; } - ((Surface)Parent).RemoveStepLabel(this); + if (Parent != null) + { + ((Surface)Parent).RemoveStepLabel(this); + } if (_stringFormat != null) { _stringFormat.Dispose(); _stringFormat = null;