Index: trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 1795)
+++ trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 1797)
@@ -61,5 +61,5 @@
         if (Main.map != null) {
             BoundingXYVisitor bbox = getBoundingBox();
-            if (bbox != null) {
+            if (bbox != null && bbox.getBounds() != null) {
                 Main.map.mapView.recalculateCenterScale(bbox);
             }
Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 1795)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 1797)
@@ -321,11 +321,11 @@
      */
     public void recalculateCenterScale(BoundingXYVisitor box) {
-        if(box == null) {
+        if (box == null) {
             box = new BoundingXYVisitor();
         }
-        if(box.getBounds() == null) {
+        if (box.getBounds() == null) {
             box.visit(getProjection().getWorldBounds());
         }
-        if(!box.hasExtend()) {
+        if (!box.hasExtend()) {
             box.enlargeBoundingBox();
         }
Index: trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 1795)
+++ trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 1797)
@@ -138,5 +138,5 @@
      */
     public Point getPoint(EastNorth p) {
-        if(null == p)
+        if (null == p)
             return new Point();
         double x = (p.east()-center.east())/scale + getWidth()/2;
@@ -146,7 +146,7 @@
 
     public Point getPoint(LatLon latlon) {
-        if(latlon == null)
+        if (latlon == null)
             return new Point();
-        else if(latlon instanceof CachedLatLon)
+        else if (latlon instanceof CachedLatLon)
             return getPoint(((CachedLatLon)latlon).getEastNorth());
         else
@@ -165,6 +165,5 @@
 /* TODO: check that newCenter is really inside visible world and that scale is correct, don't allow zooming out to much */
         boolean rep = false;
-        if(!newCenter.equals(center))
-        {
+        if (!newCenter.equals(center)) {
             EastNorth oldCenter = center;
             center = newCenter;
@@ -172,6 +171,5 @@
             firePropertyChange("center", oldCenter, newCenter);
         }
-        if(scale != newScale)
-        {
+        if (scale != newScale) {
             double oldScale = scale;
             scale = newScale;
@@ -188,5 +186,5 @@
 
     public void zoomTo(LatLon newCenter) {
-        if(newCenter instanceof CachedLatLon)
+        if (newCenter instanceof CachedLatLon)
             zoomTo(((CachedLatLon)newCenter).getEastNorth(), scale);
         else
Index: trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 1795)
+++ trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 1797)
@@ -8,4 +8,5 @@
 
 public class OsmUrlToBounds {
+    
     public static Bounds parse(String url) {
         int i = url.indexOf('?');
@@ -56,6 +57,5 @@
     }
 
-    static public int getZoom(Bounds b)
-    {
+    static public int getZoom(Bounds b) {
         // convert to mercator (for calculation of zoom only)
         double latMin = Math.log(Math.tan(Math.PI/4.0+b.min.lat()/180.0*Math.PI/2.0))*180.0/Math.PI;
@@ -72,11 +72,9 @@
     }
 
-    static public String getURL(Bounds b)
-    {
+    static public String getURL(Bounds b) {
         return getURL(b.getCenter(), getZoom(b));
     }
 
-    static public String getURL(LatLon pos, int zoom)
-    {
+    static public String getURL(LatLon pos, int zoom) {
         // Truncate lat and lon to something more sensible
         int decimals = (int) Math.pow(10, (zoom / 3));
