Index: trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 18510)
+++ trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 18513)
@@ -158,5 +158,5 @@
     public List<Pair<Node, Node>> getNodePairs(boolean sort) {
         // For a way of size n, there are n - 1 pairs (a -> b, b -> c, c -> d, etc., 4 nodes -> 3 pairs)
-        List<Pair<Node, Node>> chunkSet = new ArrayList<>(this.getNodesCount() - 1);
+        List<Pair<Node, Node>> chunkSet = new ArrayList<>(Math.max(0, this.getNodesCount() - 1));
         if (isIncomplete()) return chunkSet;
         Node lastN = null;
