altosui: Handle missing pad distance in descent tab
[fw/altos] / altosui / AltosDescent.java
index e9ff590b735e6d79dbec25187ad421426bd9f8f0..a71cdc10c0fc97f2305951365294cc165f1d3580 100644 (file)
@@ -309,7 +309,10 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay {
 
        class Distance extends DescentValue {
                void show(AltosState state, int crc_errors) {
-                       show(AltosConvert.distance, state.from_pad.distance);
+                       if (state.from_pad != null)
+                               show(AltosConvert.distance, state.from_pad.distance);
+                       else
+                               show("???");
                }
 
                public Distance (GridBagLayout layout, int x, int y) {