Fix crash on 'dodgy' .man file in v3

This is a fix for bug 205 which is registered against v2.1 but
is also present in v3. This fix will not be relevant for v2.1
since the cpi file has been replaced with the cpx file.
This commit is contained in:
Mark Liversedge
2011-08-02 02:05:32 +01:00
parent 043e66a00e
commit 84e6aa2d98

View File

@@ -558,6 +558,10 @@ MeanMaxComputer::run()
double secs = round(p->secs * 1000.0) / 1000;
if (secs > 0) data.points.append(cpintpoint(secs, (int) round(p->value(baseSeries))));
}
// don't bother with insufficient data
if (!data.points.count()) return;
int total_secs = (int) ceil(data.points.back().secs);
// don't allow data more than two days