Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 12090)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 12091)
@@ -1301,5 +1301,5 @@
     public Collection<? extends OsmPrimitive> getPreservedPrimitives() {
         DataSet ds = getLayerManager().getEditDataSet();
-        return ds != null ? ds.getSelected() : null;
+        return ds != null ? ds.getSelected() : Collections.emptySet();
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 12090)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 12091)
@@ -4,4 +4,5 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
@@ -100,3 +101,13 @@
         }
     }
+
+    /**
+     * Non regression test case for bug #14762.
+     */
+    @Test
+    public void testTicket14762() {
+        DrawAction action = new DrawAction();
+        assertNull(action.getLayerManager().getEditDataSet());
+        assertEquals(0, action.getPreservedPrimitives().size());
+    }
 }
