altosdroid: Deal with AltosState changes
[fw/altos] / altosui / AltosGraphUI.java
index db0cac2ffe178b60c58cfd27595893f23d49385a..71aa0e6f9c719669ae54a56e182f85d510dc25a2 100644 (file)
@@ -46,17 +46,19 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
                boolean                 any_gps = false;
                AltosGPSTimeValue       gtv_last = null;
 
                boolean                 any_gps = false;
                AltosGPSTimeValue       gtv_last = null;
 
-               for (AltosGPSTimeValue gtv : flight_series.gps_series) {
-                       gtv_last = gtv;
-                       AltosGPS gps = gtv.gps;
-                       if (gps != null &&
-                           gps.locked &&
-                           gps.nsat >= 4) {
-                               if (map == null)
-                                       map = new AltosUIMap();
-                               map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time));
-                               this.gps = gps;
-                               has_gps = true;
+               if (flight_series.gps_series != null) {
+                       for (AltosGPSTimeValue gtv : flight_series.gps_series) {
+                               gtv_last = gtv;
+                               AltosGPS gps = gtv.gps;
+                               if (gps != null &&
+                                   gps.locked &&
+                                   gps.nsat >= 4) {
+                                       if (map == null)
+                                               map = new AltosUIMap();
+                                       map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time));
+                                       this.gps = gps;
+                                       has_gps = true;
+                               }
                        }
                }
                if (gtv_last != null) {
                        }
                }
                if (gtv_last != null) {