From 6fe32e0fc407522101e805cf2653253cb3cee291 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 27 Mar 2013 22:11:53 -0700 Subject: [PATCH] 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 --- altoslib/AltosConfigData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { /* 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()); -- 2.30.2