Changeset 16552 in josm


Ignore:
Timestamp:
2020-06-07T14:45:04+02:00 (5 years ago)
Author:
GerdP
Message:

fix #19240: NPE in MultipolygonCache.clear

  • synchronize initializeInternalData()
  • avoid to call MultipolygonCache.clear() with null
File:
1 edited

Legend:

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

    r16381 r16552  
    128128     * Initializes territories using the internal data only.
    129129     */
    130     public static void initializeInternalData() {
     130    public static synchronized void initializeInternalData() {
    131131        iso3166Cache = new HashMap<>();
    132132        taginfoCache = new TreeMap<>();
     
    167167            throw new JosmRuntimeException(ex);
    168168        } finally {
    169             MultipolygonCache.getInstance().clear(dataSet);
     169            if (dataSet != null)
     170                MultipolygonCache.getInstance().clear(dataSet);
    170171            if (!Logging.isDebugEnabled()) {
    171172                // unset dataSet to save memory, see #18907
Note: See TracChangeset for help on using the changeset viewer.