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


Ignore:
Timestamp:
2008-09-09T08:28:56+02:00 (16 years ago)
Author:
framm
Message:

+ npe fix as suggested by Christoph Seitz <christoph_seitz@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r936 r937  
    336336                Object pd[] = pluginMap.keySet().toArray();
    337337                Arrays.sort(pd);
    338                 for(Object d : pd)
    339                 {
    340                         if(pluginMap.get(d))
     338                for (Object d : pd) {
     339                        if (pluginMap.get(d))
    341340                                plugins += ((PluginDescription)d).name + ",";
    342341                }
    343                 if(plugins.endsWith(","))
     342                if (plugins.endsWith(","))
    344343                        plugins = plugins.substring(0, plugins.length()-1);
    345                 if(plugins.length() == 0)
     344                if (plugins.length() == 0)
    346345                        plugins = null;
    347346
    348347                String oldPlugins = Main.pref.get("plugins");
    349                 if(oldPlugins == null && plugins == null)
    350                         return;
    351                 if(plugins == null || oldPlugins == null || !plugins.equals(oldPlugins))
    352                 {
     348                if ((plugins == null && oldPlugins != null) ||
     349            plugins != null && !plugins.equals(oldPlugins)) {
    353350                        Main.pref.put("plugins", plugins);
    354351                        gui.requiresRestart = true;
Note: See TracChangeset for help on using the changeset viewer.