Changeset 1188 in josm


Ignore:
Timestamp:
Dec 28, 2008 3:21:13 PM (4 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.