Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 14330)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 14331)
@@ -34,4 +34,5 @@
 import java.util.Base64;
 import java.util.Collection;
+import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -315,5 +316,5 @@
 
     /** small cache of critical images used in many parts of the application */
-    private static final Map<OsmPrimitiveType, ImageIcon> osmPrimitiveTypeCache = new HashMap<>();
+    private static final Map<OsmPrimitiveType, ImageIcon> osmPrimitiveTypeCache = new EnumMap<>(OsmPrimitiveType.class);
 
     /** larger cache of critical padded image icons used in many parts of the application */
@@ -1634,8 +1635,12 @@
         }
 
-        if (realWidth == 0 || realHeight == 0) {
+        int roundedWidth = Math.round(realWidth);
+        int roundedHeight = Math.round(realHeight);
+        if (roundedWidth <= 0 || roundedHeight <= 0) {
+            Logging.error("createImageFromSvg: {0} {1} realWidth={2} realHeight={3}",
+                    svg.getXMLBase(), dim, Float.toString(realWidth), Float.toString(realHeight));
             return null;
         }
-        BufferedImage img = new BufferedImage(Math.round(realWidth), Math.round(realHeight), BufferedImage.TYPE_INT_ARGB);
+        BufferedImage img = new BufferedImage(roundedWidth, roundedHeight, BufferedImage.TYPE_INT_ARGB);
         Graphics2D g = img.createGraphics();
         g.setClip(0, 0, img.getWidth(), img.getHeight());
