Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 18922)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 18927)
@@ -7,4 +7,6 @@
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
+import java.net.MalformedURLException;
+import java.net.URI;
 import java.util.Collections;
 
@@ -92,3 +94,14 @@
         }
     }
+
+    /**
+     * Ensure that if a file is unable to be read, we return an empty list instead of a list with {@code null} in it.
+     */
+    @Test
+    void testNonRegression23316() throws MalformedURLException {
+        MarkerLayer layer = new MarkerLayer(new GpxData(), null, null, null);
+        layer.setCurrentMarker(new ImageMarker(LatLon.ZERO, URI.create("file:/not_a_real_file_123456789.jpg").toURL(),
+                layer, 0, 0));
+        assertEquals(Collections.emptyList(), layer.getSelection());
+    }
 }
