projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Provide timeout value to ao_radio_recv
[fw/altos]
/
altosui
/
AltosSiteMapCache.java
diff --git
a/altosui/AltosSiteMapCache.java
b/altosui/AltosSiteMapCache.java
index 617ed4a9a3331193271b03f4dd4b56b6eb406eb3..40c8ff6bf0dc078beff6f8b5016f8910ffe2f4c4 100644
(file)
--- a/
altosui/AltosSiteMapCache.java
+++ b/
altosui/AltosSiteMapCache.java
@@
-19,6
+19,7
@@
package altosui;
import javax.swing.*;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.imageio.ImageIO;
+import java.awt.image.*;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
@@
-87,7
+88,14
@@
public class AltosSiteMapCache extends JLabel {
}
try {
}
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;
} catch (IOException e) {
System.out.printf("# IO error trying to load %s\n", pngfile);
return null;