summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-16 17:13:04 -0700
committerKeith Packard <keithp@keithp.com>2012-10-16 17:13:04 -0700
commitef9cb19d8b210e02eaa1c657833c1bd5fc619ad8 (patch)
tree4e4ceec0b0d79f9a9ecaf0c82e94b6407c4b0fd0 /altosui
parent60880bda2153ba3122c7102cd2bacbcca73b9e0d (diff)
altosui: Handle missing pad distance in descent tab
When the GPS isn't locked, the distance from the pad cannot be computed and is left missing. Not crashing in this case is more useful. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r--altosui/AltosDescent.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java
index e9ff590b..a71cdc10 100644
--- a/altosui/AltosDescent.java
+++ b/altosui/AltosDescent.java
@@ -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) {