# HG changeset patch # User moel.mich # Date 1343285456 0 # Node ID df64b56ece658c409d807639d4ea93af5289fe87 # Parent 01d283b11596f4b729d6564f842b70360861618b Fixed an error where loading config files from previous versions would crash the application. diff -r 01d283b11596 -r df64b56ece65 Hardware/Sensor.cs --- a/Hardware/Sensor.cs Wed Jul 25 18:10:10 2012 +0000 +++ b/Hardware/Sensor.cs Thu Jul 26 06:50:56 2012 +0000 @@ -99,6 +99,7 @@ try { byte[] array = Convert.FromBase64String(s); s = null; + DateTime now = DateTime.UtcNow; using (MemoryStream m = new MemoryStream(array)) using (GZipStream c = new GZipStream(m, CompressionMode.Decompress)) using (BinaryReader reader = new BinaryReader(c)) { @@ -106,7 +107,9 @@ long t = 0; while (true) { t += reader.ReadInt64(); - DateTime time = DateTime.FromBinary(t); + DateTime time = DateTime.FromBinary(t); + if (time > now) + break; float value = reader.ReadSingle(); AppendValue(value, time); }