Index: trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 402)
+++ trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 403)
@@ -7,4 +7,6 @@
 import java.awt.event.ActionEvent;
 import java.util.Collection;
+
+import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
@@ -37,6 +39,10 @@
 
 	public void actionPerformed(ActionEvent e) {
-		if (Main.map != null)
-			Main.map.mapView.recalculateCenterScale(getBoundingBox());
+		if (Main.map != null) {
+			BoundingXYVisitor bbox = getBoundingBox();
+			if (bbox != null) {
+				Main.map.mapView.recalculateCenterScale(bbox);
+			}
+		}
 		putValue("active", true);
 	}
@@ -51,4 +57,9 @@
 		else if (mode.equals("selection") || mode.equals("conflict")) {
 			Collection<OsmPrimitive> sel = mode.equals("selection") ? Main.ds.getSelected() : Main.map.conflictDialog.conflicts.keySet();
+			if (sel.isEmpty()) {
+	    		JOptionPane.showMessageDialog(Main.parent,
+	    				mode.equals("selection") ? tr("Nothing selected to zoom to.") : tr("No conflicts to zoom to"));
+	        		return null;
+			}
 			for (OsmPrimitive osm : sel)
 				osm.visit(v);
