Index: /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java
===================================================================
--- /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java	(revision 14132)
+++ /applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java	(revision 14133)
@@ -148,6 +148,8 @@
             if(mv.getActiveLayer() instanceof GpxLayer) {
                 GpxData data=((GpxLayer)Main.map.mapView.getActiveLayer()).data;
-                filename = data.storageFile.getName()
-                                .replaceAll("[&?/\\\\]"," ").replaceAll("(\\.[^.]*)$","");
+                try {
+                    filename = data.storageFile.getName()
+                                    .replaceAll("[&?/\\\\]"," ").replaceAll("(\\.[^.]*)$","");
+                } catch(Exception e) { }
                 descriptionField.setText(getFilename());
                 OutputDisplay.setText(tr("Selected track: {0}", getFilename()));
