Changeset 6312 in josm


Ignore:
Timestamp:
2013-10-07T11:06:57+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #9161 - "java.lang.IllegalStateException" errors when accessing preferences with a blank profile

File:
1 edited

Legend:

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

    r6310 r6312  
    740740        try {
    741741            Matcher m = Pattern.compile("mappaint\\.(.+?)\\.(.+)").matcher(o);
    742             m.matches();
    743             return tr("Paint style {0}: {1}", tr(m.group(1)), tr(m.group(2)));
     742            if (m.matches()) {
     743                return tr("Paint style {0}: {1}", tr(m.group(1)), tr(m.group(2)));
     744            }
    744745        } catch (Exception e) {
    745746            Main.warn(e);
     
    747748        try {
    748749            Matcher m = Pattern.compile("layer (.+)").matcher(o);
    749             m.matches();
    750             return tr("Layer: {0}", tr(m.group(1)));
     750            if (m.matches()) {
     751                return tr("Layer: {0}", tr(m.group(1)));
     752            }
    751753        } catch (Exception e) {
    752754            Main.warn(e);
Note: See TracChangeset for help on using the changeset viewer.