Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 9913)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 9914)
@@ -206,6 +206,6 @@
                 scaleList = scaleList.withIntermediateSteps(PROP_ZOOM_RATIO.get());
             }
-            Scale scale = scaleList.scaleZoomTimes(getScale(), PROP_ZOOM_RATIO.get(), times);
-            return scale.getScale();
+            Scale s = scaleList.scaleZoomTimes(getScale(), PROP_ZOOM_RATIO.get(), times);
+            return s != null ? s.getScale() : 0;
         } else {
             return getScale() * Math.pow(PROP_ZOOM_RATIO.get(), times);
Index: /trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java	(revision 9913)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java	(revision 9914)
@@ -222,6 +222,5 @@
         public Scale scaleZoomIn(double scale, double ratio) {
             Scale snap = getSnapScale(scale, ratio, false);
-            Scale next = getNextIn(snap, ratio);
-            return next;
+            return getNextIn(snap, ratio);
         }
 
@@ -234,6 +233,5 @@
         public Scale scaleZoomOut(double scale, double ratio) {
             Scale snap = getSnapScale(scale, ratio, false);
-            Scale next = getNextOut(snap, ratio);
-            return next;
+            return getNextOut(snap, ratio);
         }
 
@@ -248,4 +246,6 @@
 
         private Scale getNextIn(Scale scale, double ratio) {
+            if (scale == null)
+                return null;
             int nextIndex = scale.getIndex() + 1;
             if (nextIndex <= 0 || nextIndex > this.scales.size()-1) {
@@ -258,4 +258,6 @@
 
         private Scale getNextOut(Scale scale, double ratio) {
+            if (scale == null)
+                return null;
             int nextIndex = scale.getIndex() - 1;
             if (nextIndex < 0 || nextIndex >= this.scales.size()-1) {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java	(revision 9913)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java	(revision 9914)
@@ -60,9 +60,11 @@
     @Override
     protected int getBestZoom() {
-        if (!Main.isDisplayingMapView()) return 0;
+        if (!Main.isDisplayingMapView())
+            return 0;
+        Scale snap = getNativeScales().getSnapScale(Main.map.mapView.getScale(), false);
         return Math.max(
                 getMinZoomLvl(),
                 Math.min(
-                        getNativeScales().getSnapScale(Main.map.mapView.getScale(), false).getIndex(),
+                        snap != null ? snap.getIndex() : getMaxZoomLvl(),
                         getMaxZoomLvl()
                         )
