Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 9468)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 9469)
@@ -7,4 +7,5 @@
 import java.io.IOException;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -79,12 +80,16 @@
                     }
                 }
-                System.out.println(style.isValid() ? " => OK" : " => KO");
-                Collection<Throwable> errors = style.getErrors();
-                Collection<String> warnings = style.getWarnings();
-                if (!errors.isEmpty()) {
-                    allErrors.put(source.url, errors);
-                }
-                if (!warnings.isEmpty()) {
-                    allWarnings.put(source.url, warnings);
+                if (style != null) {
+                    System.out.println(style.isValid() ? " => OK" : " => KO");
+                    Collection<Throwable> errors = style.getErrors();
+                    Collection<String> warnings = style.getWarnings();
+                    if (!errors.isEmpty()) {
+                        allErrors.put(source.url, errors);
+                    }
+                    if (!warnings.isEmpty()) {
+                        allWarnings.put(source.url, warnings);
+                    }
+                } else {
+                    allWarnings.put(source.url, Collections.singleton("MapPaintStyles.addStyle() returned null"));
                 }
             }
