Changeset 14007 in josm for trunk


Ignore:
Timestamp:
2018-07-06T19:58:37+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #16466 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

    r13811 r14007  
    2323import org.openstreetmap.josm.data.osm.Way;
    2424import org.openstreetmap.josm.data.osm.search.SearchCompiler.InDataSourceArea;
     25import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon;
    2526import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache;
    2627import org.openstreetmap.josm.gui.mappaint.Cascade;
     
    764765            if (e.osm instanceof Way && ((Way) e.osm).isClosed())
    765766                return true;
    766             if (e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon())
    767                 return MultipolygonCache.getInstance().get((Relation) e.osm).getOpenEnds().isEmpty();
     767            if (e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon()) {
     768                Multipolygon multipolygon = MultipolygonCache.getInstance().get((Relation) e.osm);
     769                return multipolygon != null && multipolygon.getOpenEnds().isEmpty();
     770            }
    768771            return false;
    769772        }
Note: See TracChangeset for help on using the changeset viewer.