altoslib: Ensure eeprom file body always exists
authorKeith Packard <keithp@keithp.com>
Tue, 3 Sep 2013 23:31:58 +0000 (17:31 -0600)
committerKeith Packard <keithp@keithp.com>
Tue, 3 Sep 2013 23:31:58 +0000 (17:31 -0600)
Create an empty list of body elements if none were read from the file

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosEepromFile.java

index 367b67915542a89d0372b133057b37d449760735..082c23ca5149dee65e111d12b3c61308284d1249 100644 (file)
@@ -91,6 +91,9 @@ public class AltosEepromFile extends AltosStateIterable {
                case AltosLib.AO_LOG_FORMAT_EASYMINI:
                        body = new AltosEepromIterable(AltosEepromMini.read(input));
                        break;
+               default:
+                       body = new AltosEepromIterable(new LinkedList<AltosEeprom>());
+                       break;
                }
 
                /* Find boost tick */