Changeset 1590 in josm for trunk/src/org


Ignore:
Timestamp:
2009-05-14T18:02:02+02:00 (16 years ago)
Author:
stoecker
Message:

fixed #2572 - patch by Gubaer - fixed illegal access on nonexisting files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java

    r1309 r1590  
    250250        final JPanel p = new JPanel(new BorderLayout());
    251251        final ImageEntry e = data.get(currentImage);
     252        if (!(e.image.exists() && e.image.canRead()))
     253        {
     254            JOptionPane.showMessageDialog(Main.parent,
     255            tr("Image with path {0} does not exist or is not readable.", e.image),
     256            tr("Warning"), JOptionPane.WARNING_MESSAGE);
     257            return;
     258        }
    252259        final JScrollPane scroll = new JScrollPane(new JLabel(loadScaledImage(e.image, 580)));
    253260        final JViewport vp = scroll.getViewport();
Note: See TracChangeset for help on using the changeset viewer.