diff options
author | Keith Packard <keithp@keithp.com> | 2013-04-22 17:20:51 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-04-22 17:20:51 -0500 |
commit | 33c3b2c57d0d4285b75d4dcf7ca67ad19da08c86 (patch) | |
tree | a9ff47afab29fe141dcd1da0ca276b367f911cb6 /altosui/AltosSiteMapCache.java | |
parent | 1a84db819a359be39be51c9105039ab28c9fc894 (diff) | |
parent | 90b0db1ae53182c94bf12d661446fc369d916366 (diff) |
Merge branch 'master' into stm-flash
Conflicts:
ao-tools/ao-stmload/ao-stmload.c
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; |