fixed nullpointer

This commit is contained in:
xrgman
2015-04-07 12:13:40 +02:00
parent 5a9c3f259a
commit 1684976a47
+6 -2
View File
@@ -190,8 +190,12 @@ public abstract class DrawObject
{
Shape ownShape = getRectangle();
Rectangle2D otherRectangle = object.getTransform().createTransformedShape(object.getImageRectangle()).getBounds2D();
if (ownShape.intersects(otherRectangle))
return true;
if(ownShape != null && otherRectangle != null) {
if (ownShape.intersects(otherRectangle))
return true;
else
return false;
}
else
return false;
}