From: Keith Packard Date: Wed, 17 Oct 2012 00:13:04 +0000 (-0700) Subject: altosui: Handle missing pad distance in descent tab X-Git-Tag: 1.1.9.1~12 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=ef9cb19d8b210e02eaa1c657833c1bd5fc619ad8;hp=60880bda2153ba3122c7102cd2bacbcca73b9e0d;ds=sidebyside 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 --- 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) {