diff options
author | Keith Packard <keithp@keithp.com> | 2013-04-17 10:41:05 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-04-17 10:41:05 -0700 |
commit | ff332e640b27c6be37dabef58ebac350ac2347b2 (patch) | |
tree | f443bfd9b6ee740a041ccf9b474e5bdfadb3a700 /altosui/AltosSiteMapCache.java | |
parent | b3000609e4010ff4d29debe72ea1866e775af539 (diff) | |
parent | 87d6ed24f3650981ae1ff9bfdb0298d2c01e7575 (diff) |
Merge branch 'master' into droid-gps
Diffstat (limited to 'altosui/AltosSiteMapCache.java')
-rw-r--r-- | altosui/AltosSiteMapCache.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/altosui/AltosSiteMapCache.java b/altosui/AltosSiteMapCache.java index 617ed4a9..40c8ff6b 100644 --- a/altosui/AltosSiteMapCache.java +++ b/altosui/AltosSiteMapCache.java @@ -19,6 +19,7 @@ package altosui; import javax.swing.*; import javax.imageio.ImageIO; +import java.awt.image.*; import java.io.*; import java.net.URL; import java.net.URLConnection; @@ -87,7 +88,14 @@ public class AltosSiteMapCache extends JLabel { } try { - return new ImageIcon(ImageIO.read(pngfile)); + BufferedImage img; + + img = ImageIO.read(pngfile); + if (img == null) { + System.out.printf("# Can't read pngfile %s\n", pngfile); + return null; + } + return new ImageIcon(img); } catch (IOException e) { System.out.printf("# IO error trying to load %s\n", pngfile); return null; |