Changeset 17316 in josm


Ignore:
Timestamp:
2020-11-16T23:37:05+01:00 (2 weeks ago)
Author:
Don-vip
Message:

see #7548 - fix #20094 - fix NPE

File:
1 edited

Legend:

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

    r17315 r17316  
    575575    private int computeMaxTabWidth() {
    576576        FontMetrics fm = getFontMetrics(getFont());
    577         return settings.stream().filter(x -> x instanceof TabPreferenceSetting)
    578                 .mapToInt(x -> fm.stringWidth(((TabPreferenceSetting) x).getTitle())).max().orElse(120);
     577        return settings.stream().filter(x -> x instanceof TabPreferenceSetting).map(x -> ((TabPreferenceSetting) x).getTitle())
     578                .filter(Objects::nonNull).mapToInt(fm::stringWidth).max().orElse(120);
    579579    }
    580580
Note: See TracChangeset for help on using the changeset viewer.