BUG-2213: Fix referencing null freehandPath

This commit is contained in:
Krom, Robertus 2017-06-21 08:35:08 +02:00
commit b85f9e66a3

View file

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