Changeset 5740 in josm for trunk


Ignore:
Timestamp:
2013-02-21T23:58:58+01:00 (7 years ago)
Author:
Don-vip
Message:

see #8449 - fix NPE but filter does not work as expected at JOSM restart (needs to be switched off/on)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r5598 r5740  
    10821082        protected abstract Bounds getBounds();
    10831083        protected final boolean all;
    1084         protected final Bounds bounds;
    10851084
    10861085        /**
     
    10891088        public InArea(boolean all) {
    10901089            this.all = all;
    1091             this.bounds = getBounds();
    10921090        }
    10931091
     
    10961094            if (!osm.isUsable())
    10971095                return false;
    1098             else if (osm instanceof Node)
    1099                 return bounds.contains(((Node) osm).getCoor());
    1100             else if (osm instanceof Way) {
     1096            else if (osm instanceof Node) {
     1097                Bounds bounds = getBounds();
     1098                return bounds != null && bounds.contains(((Node) osm).getCoor());
     1099            } else if (osm instanceof Way) {
    11011100                Collection<Node> nodes = ((Way) osm).getNodes();
    11021101                return all ? forallMatch(nodes) : existsMatch(nodes);
     
    11351134        @Override
    11361135        protected Bounds getBounds() {
     1136            if (Main.map == null || Main.map.mapView == null) {
     1137                return null;
     1138            }
    11371139            return Main.map.mapView.getRealBounds();
    11381140        }
Note: See TracChangeset for help on using the changeset viewer.