altoslib: Stop re-loading previous flight when starting telemetry monitoring
[fw/altos] / altoslib / AltosTelemetryReader.java
index 8803e19f74087b528fdc0281877d03bb85a00ec9..20526a2c584b95d4780a54cfae4a5ef73fa2718f 100644 (file)
@@ -185,6 +185,9 @@ public class AltosTelemetryReader extends AltosFlightReader {
        }
 
        private static AltosFlightReader existing_data(AltosLink link) {
+               if (link == null)
+                       return null;
+
                File    file = AltosPreferences.logfile(link.serial);
                if (file != null) {
                        AltosStateIterable      iterable = AltosStateIterable.iterable(file);
@@ -196,6 +199,6 @@ public class AltosTelemetryReader extends AltosFlightReader {
 
        public AltosTelemetryReader(AltosLink link)
                throws IOException, InterruptedException, TimeoutException {
-               this(link, existing_data(link));
+               this(link, null);
        }
 }