Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 15196)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 15204)
@@ -550,5 +550,5 @@
                 return;
 
-            if (mouseIsDragging(e)) {
+            if (mouseIsDragging(e) && mousePointInImg != null) {
                 Point p = comp2imgCoord(visibleRect, e.getX(), e.getY(), getSize());
                 visibleRect.isDragUpdate = true;
@@ -564,5 +564,5 @@
             }
 
-            if (mouseIsZoomSelecting(e)) {
+            if (mouseIsZoomSelecting(e) && mousePointInImg != null) {
                 Point p = comp2imgCoord(visibleRect, e.getX(), e.getY(), getSize());
                 visibleRect.checkPointInside(p);
