altoslib: Don't crash if there's no GPS coord to write KML
authorKeith Packard <keithp@keithp.com>
Thu, 12 Oct 2017 07:29:07 +0000 (00:29 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 12 Oct 2017 07:29:07 +0000 (00:29 -0700)
Just check for null before writing as a precaution.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosKML.java

index 4738ac9104925fab8af6eefb57f5a7a214dd600a..aa98f0e69bf78a07de44940ce784be9b3bfa488a 100644 (file)
@@ -244,6 +244,8 @@ public class AltosKML implements AltosWriter {
 
        public void write(AltosGPS gps, double alt)
        {
+               if (gps == null)
+                       return;
                if (gps.lat == AltosLib.MISSING)
                        return;
                if (gps.lon == AltosLib.MISSING)