Changeset 1188 in josm for trunk


Ignore:
Timestamp:
2008-12-28T15:21:13+01:00 (15 years ago)
Author:
stoecker
Message:

fixed NPE's

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r1169 r1188  
    392392
    393393        try {
    394             UIManager.setLookAndFeel(Main.pref.get("laf"));
     394            try {
     395              UIManager.setLookAndFeel(Main.pref.get("laf"));
     396            }
     397            catch (final javax.swing.UnsupportedLookAndFeelException e) {
     398                System.out.println("Look and Feel not supported: " + Main.pref.get("laf"));
     399            }
    395400            toolbar = new ToolbarPreferences();
    396401            contentPane.updateUI();
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r1187 r1188  
    373373
    374374        }
    375 
    376375        LinkedList<String> plugins = new LinkedList<String>();
    377         Object pds[] = pluginMap.keySet().toArray();
    378         Arrays.sort(pds);
    379         for (Object d : pds) {
    380             PluginDescription pd = (PluginDescription)d;
    381             if (pluginMap.get(pd.name))
    382                 plugins.add(pd.name);
    383         }
    384 
     376        for (Map.Entry<String, Boolean> d : pluginMap.entrySet()) {
     377            if (d.getValue())
     378                plugins.add(d.getKey());
     379        }
     380
     381        Collections.sort(plugins);
    385382        return Main.pref.putCollection("plugins", plugins);
    386383    }
Note: See TracChangeset for help on using the changeset viewer.