diff --git a/lib/livestatus/minaggregator.cpp b/lib/livestatus/minaggregator.cpp index 05913a3d2..69fc38bad 100644 --- a/lib/livestatus/minaggregator.cpp +++ b/lib/livestatus/minaggregator.cpp @@ -22,7 +22,7 @@ using namespace icinga; MinAggregator::MinAggregator(const String& attr) - : m_Min(0), m_MinAttr(attr) + : m_Min(DBL_MAX), m_MinAttr(attr) { } void MinAggregator::Apply(const Table::Ptr& table, const Value& row) @@ -37,5 +37,8 @@ void MinAggregator::Apply(const Table::Ptr& table, const Value& row) double MinAggregator::GetResult(void) const { - return m_Min; + if (m_Min == DBL_MAX) + return 0; + else + return m_Min; }