From: Keith Packard Date: Thu, 28 Mar 2013 05:11:53 +0000 (-0700) Subject: altosui: Don't deref null pyros when saving altimeter config X-Git-Tag: altosdroid_v1.2-1~72 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=6fe32e0fc407522101e805cf2653253cb3cee291 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 --- 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());