summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-03-27 22:11:53 -0700
committerKeith Packard <keithp@keithp.com>2013-03-27 22:11:53 -0700
commit6fe32e0fc407522101e805cf2653253cb3cee291 (patch)
treeec4182cb4ab559e179687ecf4340edc54fc5e986
parent985cd22b941415b1ae2709ae1ab6b60c3d815ec1 (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.java2
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());