Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java	(revision 18630)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java	(revision 18634)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.layer.markerlayer;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
@@ -40,3 +41,16 @@
         assertEquals(LatLon.ZERO, wpt.getCoor());
     }
+
+    /**
+     * Non-regression test for #22638: NoSuchFileException causes a crash
+     */
+    @Test
+    void testTicket22638() throws MalformedURLException {
+        ImageMarker marker = new ImageMarker(
+                LatLon.ZERO,
+                new File(TestUtils.getRegressionDataFile(12255, "no_such.jpg")).toURI().toURL(),
+                new MarkerLayer(new GpxData(), null, null, null),
+                1d, 2d);
+        assertDoesNotThrow(() -> marker.actionPerformed(null));
+    }
 }
