- if (config_data.has_monitor_battery()) {
- try {
- String[] items = adc();
- for (int i = 0; i < items.length;) {
- if (items[i].equals("batt")) {
- monitor_batt = Integer.parseInt(items[i+1]);
- i += 2;
- continue;
+ try {
+ AltosConfigData config_data = config_data();
+ int monitor_batt = AltosLib.MISSING;
+
+ if (config_data.has_monitor_battery()) {
+ String[] items = adc();
+ for (int i = 0; i < items.length;) {
+ if (items[i].equals("batt")) {
+ monitor_batt = Integer.parseInt(items[i+1]);
+ i += 2;
+ continue;
+ }
+ i++;