Ignore:
Timestamp:
2008-10-15T18:09:49+02:00 (16 years ago)
Author:
hampelratte
Message:

workaround for NPE on auto updates

File:
1 edited

Legend:

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

    r11161 r11260  
    3030import java.awt.event.ActionEvent;
    3131import java.awt.event.ActionListener;
    32 import java.io.IOException;
    3332import java.net.URL;
    3433import java.util.LinkedList;
     
    131130        public void updateData() {
    132131                // determine the bounds of the currently visible area
    133                 Bounds bounds = bounds();
    134                        
     132                Bounds bounds = null;
     133                try {
     134                        bounds = bounds();
     135                } catch (Exception e) {
     136                        // something went wrong, probably the mapview isn't fully initialized
     137                        System.err.println("OpenStreetBugs: Couldn't determine bounds of currently visible rect. Cancel auto update");
     138                        return;
     139                }
     140               
    135141                try {
    136142                        // download the data
     
    141147                                updateGui();
    142148                        }
    143                 } catch (IOException e) {
     149                } catch (Exception e) {
    144150                        JOptionPane.showMessageDialog(Main.parent, e.getMessage());
    145151                        e.printStackTrace();
     
    180186                        toggle.addActionListener(new ActionListener() {
    181187                                private boolean download = true;
    182 
     188                               
    183189                                public void actionPerformed(ActionEvent e) {
    184190                                        active = toggle.isSelected();
Note: See TracChangeset for help on using the changeset viewer.