From e04679ba52761d5531037117a21ab1f1896358b0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 12 Oct 2017 00:29:07 -0700 Subject: [PATCH] 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 --- altoslib/AltosKML.java | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.30.2