diff options
author | Keith Packard <keithp@keithp.com> | 2012-09-09 12:20:08 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-09-09 12:20:08 -0700 |
commit | d65d921b9b2340fa23d3b55b4ae755324d392303 (patch) | |
tree | 03ca7666a09818d82cfd6cd17340288c89e951b3 | |
parent | c5e98d2b226824f2012e5710ac4b1596b9f0bfb1 (diff) |
altosui: Catch errors in state value when saving flight logs
Use AltosLib.state_name() instead of directly accessing the
state_to_string array so that any invalid state values are caught and
replaced with 'invalid' instead of raising an exception.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosui/AltosEepromDownload.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index 4a35c2f1..b04890cd 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -336,7 +336,7 @@ public class AltosEepromDownload implements Runnable { state = 0; state_block = log.start_block; for (block = log.start_block; !done && block < log.end_block; block++) { - monitor.set_value(Altos.state_to_string[state], state, block - state_block); + monitor.set_value(AltosLib.state_name(state), state, block - state_block); AltosEepromChunk eechunk = new AltosEepromChunk(serial_line, block, block == log.start_block); |