altoslib: Check for valid pad alt before computing GPS height series
authorKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 23:53:03 +0000 (16:53 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 23:53:03 +0000 (16:53 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosFlightSeries.java

index 88529e2..0b60fdf 100644 (file)
@@ -237,7 +237,7 @@ public class AltosFlightSeries extends AltosDataListener {
                                height_series.add(alt.time, alt.value - ground_altitude);
                }
 
-               if (gps_height == null && cal_data.gps_pad != null && gps_altitude != null) {
+               if (gps_height == null && cal_data.gps_pad != null && cal_data.gps_pad.alt != AltosLib.MISSING && gps_altitude != null) {
                        double gps_ground_altitude = cal_data.gps_pad.alt;
                        gps_height = add_series(gps_height_name, AltosConvert.height);
                        for (AltosTimeValue gps_alt : gps_altitude)