Changeset 14817 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-04-29T14:18:12+02:00 (15 years ago)
Author:
hampelratte
Message:

fixed NPE and improved gui update behaviour: if the osm layer has been closed, while we are requesting the osb db, the gui does not have to be updated, when the request is done

Location:
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java

    r13497 r14817  
    7878        });
    7979
    80         Main.map.mapView.addMouseListener(this);
     80        // if the map layer has been closed, while we are requesting the osb db,
     81        // the mapframe is null, so we check that, before installing the mouse listener
     82        if(Main.map != null && Main.map.mapView != null) {
     83            Main.map.mapView.addMouseListener(this);
     84        }
    8185    }
    8286
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java

    r13497 r14817  
    152152            // display the parsed data
    153153            if(!dataSet.nodes.isEmpty()) {
    154                 updateGui();
     154                // if the map layer has been closed, while we are requesting the osb db,
     155                // we don't have to update the gui, because the user is not interested
     156                // in this area anymore
     157                if(Main.map != null && Main.map.mapView != null) {
     158                    updateGui();
     159                }
    155160            }
    156161        } catch (Exception e) {
Note: See TracChangeset for help on using the changeset viewer.