projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Oops. Was only filling out part of the TeleMetrum ADC record
[fw/altos]
/
altosui
/
AltosSiteMapCache.java
diff --git
a/altosui/AltosSiteMapCache.java
b/altosui/AltosSiteMapCache.java
index 6e7e423b3c2a1a0cbebcb1394e5e72f65f68a189..40c8ff6bf0dc078beff6f8b5016f8910ffe2f4c4 100644
(file)
--- a/
altosui/AltosSiteMapCache.java
+++ b/
altosui/AltosSiteMapCache.java
@@
-15,21
+15,14
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package
AltosUI
;
+package
altosui
;
-import java.awt.*;
-import java.awt.image.*;
-import java.awt.event.*;
import javax.swing.*;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.imageio.ImageIO;
-import java
x.swing.tabl
e.*;
+import java
.awt.imag
e.*;
import java.io.*;
import java.io.*;
-import java.util.*;
-import java.text.*;
-import java.util.prefs.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URL;
import java.net.URLConnection;
-import org.altusmetrum.AltosLib.*;
public class AltosSiteMapCache extends JLabel {
public static boolean fetchMap(File file, String url) {
public class AltosSiteMapCache extends JLabel {
public static boolean fetchMap(File file, String url) {
@@
-95,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;