Skip to content

Commit 023f03f

Browse files
committed
Fix: empty data point container shall return 0 for getLastUpdate()
1 parent 114c67b commit 023f03f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/DataPoints.h

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ class DataPointContainer {
140140
{
141141
auto scopedLock = lock();
142142

143+
if (_dataPoints.empty()) { return 0; }
144+
143145
uint32_t now = millis();
144146
uint32_t diff = std::numeric_limits<uint32_t>::max()/2;
145147
for (auto iter = _dataPoints.cbegin(); iter != _dataPoints.cend(); ++iter) {

0 commit comments

Comments
 (0)