Index: /trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java	(revision 9453)
+++ /trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java	(revision 9454)
@@ -28,5 +28,5 @@
  * An UI widget for displaying differences in the coordinates of two
  * {@link HistoryNode}s.
- *
+ * @since 2243
  */
 public class CoordinateInfoViewer extends JPanel {
@@ -327,5 +327,5 @@
         private final Updater updater;
 
-        public MapViewer(HistoryBrowserModel model) {
+        MapViewer(HistoryBrowserModel model) {
             this.updater = new Updater(model, PointInTimeType.REFERENCE_POINT_IN_TIME);
             setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
Index: /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java	(revision 9453)
+++ /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java	(revision 9454)
@@ -105,7 +105,9 @@
         referenceRelationMemberTableModel = new DiffTableModel();
 
-        OsmDataLayer editLayer = Main.main.getEditLayer();
-        if (editLayer != null) {
-            editLayer.data.addDataSetListener(this);
+        if (Main.main != null) {
+            OsmDataLayer editLayer = Main.main.getEditLayer();
+            if (editLayer != null) {
+                editLayer.data.addDataSetListener(this);
+            }
         }
         MapView.addLayerChangeListener(this);
Index: /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 9453)
+++ /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 9454)
@@ -63,4 +63,5 @@
 import org.openstreetmap.josm.gui.mappaint.StyleElementList;
 import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage;
+import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement;
 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
@@ -81,5 +82,4 @@
 import com.kitfox.svg.SVGDiagram;
 import com.kitfox.svg.SVGUniverse;
-import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement;
 
 /**
@@ -1057,13 +1057,15 @@
         }
         // Try user-data directory
-        String dir = new File(Main.pref.getUserDataDirectory(), "images").getAbsolutePath();
-        try {
-            u = getImageUrl(dir, imageName, additionalClassLoaders);
-            if (u != null)
-                return u;
-        } catch (SecurityException e) {
-            Main.warn(tr(
-                    "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e
-                    .toString()));
+        if (Main.pref != null) {
+            String dir = new File(Main.pref.getUserDataDirectory(), "images").getAbsolutePath();
+            try {
+                u = getImageUrl(dir, imageName, additionalClassLoaders);
+                if (u != null)
+                    return u;
+            } catch (SecurityException e) {
+                Main.warn(tr(
+                        "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e
+                        .toString()));
+            }
         }
 
@@ -1079,11 +1081,13 @@
 
         // Try all other resource directories
-        for (String location : Main.pref.getAllPossiblePreferenceDirs()) {
-            u = getImageUrl(location + "images", imageName, additionalClassLoaders);
-            if (u != null)
-                return u;
-            u = getImageUrl(location, imageName, additionalClassLoaders);
-            if (u != null)
-                return u;
+        if (Main.pref != null) {
+            for (String location : Main.pref.getAllPossiblePreferenceDirs()) {
+                u = getImageUrl(location + "images", imageName, additionalClassLoaders);
+                if (u != null)
+                    return u;
+                u = getImageUrl(location, imageName, additionalClassLoaders);
+                if (u != null)
+                    return u;
+            }
         }
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java	(revision 9454)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java	(revision 9454)
@@ -0,0 +1,28 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.history;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+
+/**
+ * Unit tests of {@link CoordinateInfoViewer} class.
+ */
+public class CoordinateInfoViewerTest {
+
+    /**
+     * Test for {@link CoordinateInfoViewer#CoordinateInfoViewer} - {@code null} handling.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testCoordinateInfoViewerNull() {
+        new CoordinateInfoViewer(null);
+    }
+
+    /**
+     * Test for {@link CoordinateInfoViewer#CoordinateInfoViewer} - nominal case.
+     */
+    @Test
+    public void testCoordinateInfoViewerNominal() {
+        assertNotNull(new CoordinateInfoViewer(new HistoryBrowserModel()));
+    }
+}
