diff options
author | Keith Packard <keithp@keithp.com> | 2013-03-27 22:11:53 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-03-27 22:11:53 -0700 |
commit | 6fe32e0fc407522101e805cf2653253cb3cee291 (patch) | |
tree | ec4182cb4ab559e179687ecf4340edc54fc5e986 | |
parent | 985cd22b941415b1ae2709ae1ab6b60c3d815ec1 (diff) |
altosui: Don't deref null pyros when saving altimeter config
The check for no pyro config is to compare npyros against zero rather
than check the length of the pyros array as the latter may be null.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altoslib/AltosConfigData.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 12659d88..45b95646 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -476,7 +476,7 @@ public class AltosConfigData implements Iterable<String> { /* UI doesn't support AES key config */ /* AO_PYRO_NUM */ - if (pyros.length > 0) { + if (npyro > 0) { for (int p = 0; p < pyros.length; p++) { link.printf("c P %s\n", pyros[p].toString()); |