From b85f9e66a3f1796032821d52727dcb11ef145f61 Mon Sep 17 00:00:00 2001 From: "Krom, Robertus" Date: Wed, 21 Jun 2017 08:35:08 +0200 Subject: [PATCH] BUG-2213: Fix referencing null freehandPath --- Greenshot/Drawing/FreehandContainer.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Greenshot/Drawing/FreehandContainer.cs b/Greenshot/Drawing/FreehandContainer.cs index e8654bc4e..cc574076b 100644 --- a/Greenshot/Drawing/FreehandContainer.cs +++ b/Greenshot/Drawing/FreehandContainer.cs @@ -235,14 +235,22 @@ namespace Greenshot.Drawing { } public override int GetHashCode() { + if (freehandPath == null) + { + return 0; + } return freehandPath.GetHashCode(); } public override bool ClickableAt(int x, int y) { bool returnValue = base.ClickableAt(x, y); if (returnValue) { + if (freehandPath == null) + { + return false; + } int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS); - using (Pen pen = new Pen(Color.White)) { + using (var pen = new Pen(Color.White)) { pen.Width = lineThickness + 10; returnValue = freehandPath.IsOutlineVisible(x-Left,y-Top, pen); }