Ignore:
Timestamp:
2017-04-26T01:03:00+02:00 (7 years ago)
Author:
donvip
Message:

fix #josm14688 - NPE

Location:
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java

    r32556 r33279  
    3232        try {
    3333            if (wmsLayer.grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
    34                 if (wmsLayer.getImages().isEmpty()) {
     34                if (!wmsLayer.hasImages()) {
    3535                    // first time we grab an image for this layer
    3636                    if (CacheControl.cacheEnabled) {
     
    5454                // grab new images from wms server into active layer
    5555                wmsLayer.grab(bounds);
    56             } else if (wmsLayer.getImages().size() == 0)
     56            } else if (!wmsLayer.hasImages()) {
    5757              // failed to contact WMS of find this commune. Remove layer if empty.
    5858              Main.getLayerManager().removeLayer(wmsLayer);
     59            }
    5960        } catch (DuplicateLayerException e) {
    6061            // we tried to grab onto a duplicated layer (removed)
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r32556 r33279  
    707707    }
    708708
     709    public boolean hasImages() {
     710        return images != null && !images.isEmpty();
     711    }
     712
    709713    public void addImage(GeorefImage img) {
    710714        imagesLock.lock();
Note: See TracChangeset for help on using the changeset viewer.