Changeset 18156 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2021-08-22T13:52:08+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21239 - fix NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTile.java

    r17867 r18156  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.imagery.vectortile.mapbox;
     3
     4import java.awt.image.BufferedImage;
     5import java.io.IOException;
     6import java.io.InputStream;
     7import java.util.Collection;
     8import java.util.HashSet;
     9import java.util.List;
     10import java.util.Objects;
     11import java.util.stream.Collectors;
    312
    413import org.openstreetmap.gui.jmapviewer.Tile;
     
    1322import org.openstreetmap.josm.tools.ListenerList;
    1423import org.openstreetmap.josm.tools.Logging;
    15 
    16 import java.awt.image.BufferedImage;
    17 import java.io.IOException;
    18 import java.io.InputStream;
    19 import java.util.Collection;
    20 import java.util.HashSet;
    21 import java.util.List;
    22 import java.util.stream.Collectors;
    2324
    2425/**
     
    6869                return mvtLayer;
    6970            }).collect(Collectors.toCollection(HashSet::new));
    70             this.extent = layers.stream().map(Layer::getExtent).max(Integer::compare).orElse(Layer.DEFAULT_EXTENT);
     71            this.extent = layers.stream().filter(Objects::nonNull).mapToInt(Layer::getExtent).max().orElse(Layer.DEFAULT_EXTENT);
    7172            if (this.getData() != null) {
    7273                this.finishLoading();
Note: See TracChangeset for help on using the changeset viewer.