Ignore:
Timestamp:
2014-02-03T20:18:15+01:00 (11 years ago)
Author:
glebius
Message:

Fix transmitting traces, that were never saved to a file, for example,
created by the EditGPX plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java

    r30060 r30260  
    479479     */
    480480    private void writeGpxFile(ByteArrayOutputStream baos, String name, GpxData gpxData) throws IOException {
     481        String filename;
     482
    481483        writeBoundary(baos);
    482484        writeString(baos, "Content-Disposition: form-data; name=\"" + name + "\"; ");
    483         writeString(baos, "filename=\"" + gpxData.storageFile.getName() + "\"");
     485        if (gpxData.storageFile != null)
     486            filename = gpxData.storageFile.getName();
     487        else
     488            filename = "not saved";
     489        writeString(baos, "filename=\"" + filename + "\"");
    484490        writeLineEnd(baos);
    485491        writeString(baos, "Content-Type: application/octet-stream");
Note: See TracChangeset for help on using the changeset viewer.