diff --git a/src/Range.cpp b/src/Range.cpp index 69aca85d..5eaee6c6 100644 --- a/src/Range.cpp +++ b/src/Range.cpp @@ -27,6 +27,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////////// // A Range consists of a start time and optional end time. A missing end @@ -285,6 +286,8 @@ std::vector Range::subtract (const Range& other) const // If the range is open, use 'now' as the end. time_t Range::total () const { + assert (end >= start); + if (is_ended ()) return Datetime (end) - Datetime (start);