Index: /trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java	(revision 9882)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java	(revision 9883)
@@ -150,4 +150,6 @@
          */
         public Scale getSnapScale(double scale, double ratio, boolean floor) {
+            if (scales.isEmpty())
+                return null;
             int size = scales.size();
             Scale first = scales.get(0);
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java	(revision 9883)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java	(revision 9883)
@@ -0,0 +1,33 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.layer;
+
+import static org.junit.Assert.assertNull;
+
+import java.util.Collections;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+
+/**
+ * Unit tests of {@link NativeScaleLayer} class.
+ */
+public class NativeScaleLayerTest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12255">#12255</a>.
+     */
+    @Test
+    public void testTicket12255() {
+        assertNull(new NativeScaleLayer.ScaleList(Collections.<Double>emptyList()).getSnapScale(10, 2, false));
+        assertNull(new NativeScaleLayer.ScaleList(new double[0]).getSnapScale(10, 2, false));
+    }
+}
