Ticket #250: [patch]delete_tmpfile_when_not_null.diff

File [patch]delete_tmpfile_when_not_null.diff, 750 bytes (added by nukehead@…, 17 years ago)

Only delete tmpFile when it is exists

  • src/org/openstreetmap/josm/actions/SaveActionBase.java

     
    125125                                        copy(file, tmpFile);
    126126                                }
    127127                                OsmWriter.output(new FileOutputStream(file), new OsmWriter.All(layer.data, false));
    128                                 if (!Main.pref.getBoolean("save.keepbackup"))
     128                                if (tmpFile != null && !Main.pref.getBoolean("save.keepbackup"))
    129129                                        tmpFile.delete();
    130130                        } else if (ExtensionFileFilter.filters[ExtensionFileFilter.CSV].acceptName(file.getPath())) {
    131131                                JOptionPane.showMessageDialog(Main.parent, tr("CSV output not supported yet."));