Changeset 13300 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-01-08T02:45:59+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #15742 - check downloaded plugin is valid *before* we delete any existing one (patch by ris)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r13294 r13300  
    12581258            File plugin = new File(filePath.substring(0, filePath.length() - 4));
    12591259            String pluginName = updatedPlugin.getName().substring(0, updatedPlugin.getName().length() - 8);
    1260             if (plugin.exists() && !plugin.delete() && dowarn) {
    1261                 Logging.warn(tr("Failed to delete outdated plugin ''{0}''.", plugin.toString()));
    1262                 Logging.warn(tr("Failed to install already downloaded plugin ''{0}''. " +
    1263                         "Skipping installation. JOSM is still going to load the old plugin version.",
    1264                         pluginName));
    1265                 continue;
    1266             }
    12671260            try {
    12681261                // Check the plugin is a valid and accessible JAR file before installing it (fix #7754)
     
    12731266                            plugin.toString(), updatedPlugin.toString(), e.getLocalizedMessage()), e);
    12741267                }
     1268                continue;
     1269            }
     1270            if (plugin.exists() && !plugin.delete() && dowarn) {
     1271                Logging.warn(tr("Failed to delete outdated plugin ''{0}''.", plugin.toString()));
     1272                Logging.warn(tr("Failed to install already downloaded plugin ''{0}''. " +
     1273                        "Skipping installation. JOSM is still going to load the old plugin version.",
     1274                        pluginName));
    12751275                continue;
    12761276            }
Note: See TracChangeset for help on using the changeset viewer.