diff options
author | Keith Packard <keithp@keithp.com> | 2017-10-12 00:29:07 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-10-12 00:29:07 -0700 |
commit | e04679ba52761d5531037117a21ab1f1896358b0 (patch) | |
tree | 9093f61782ddca8753f988ded8163c0d809662f4 | |
parent | a69d5773a63dbe5d6d758cea8eca2bf724e9d672 (diff) |
altoslib: Don't crash if there's no GPS coord to write KML
Just check for null before writing as a precaution.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altoslib/AltosKML.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java index 4738ac91..aa98f0e6 100644 --- a/altoslib/AltosKML.java +++ b/altoslib/AltosKML.java @@ -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) |