Fixed an error where loading config files from previous versions would crash the application.
1.1 --- a/Hardware/Sensor.cs Wed Jul 25 18:10:10 2012 +0000
1.2 +++ b/Hardware/Sensor.cs Thu Jul 26 06:50:56 2012 +0000
1.3 @@ -99,6 +99,7 @@
1.4 try {
1.5 byte[] array = Convert.FromBase64String(s);
1.6 s = null;
1.7 + DateTime now = DateTime.UtcNow;
1.8 using (MemoryStream m = new MemoryStream(array))
1.9 using (GZipStream c = new GZipStream(m, CompressionMode.Decompress))
1.10 using (BinaryReader reader = new BinaryReader(c)) {
1.11 @@ -106,7 +107,9 @@
1.12 long t = 0;
1.13 while (true) {
1.14 t += reader.ReadInt64();
1.15 - DateTime time = DateTime.FromBinary(t);
1.16 + DateTime time = DateTime.FromBinary(t);
1.17 + if (time > now)
1.18 + break;
1.19 float value = reader.ReadSingle();
1.20 AppendValue(value, time);
1.21 }