Fix #753: Only apply offset if data is in the buffer to prevent negative numbers

This commit is contained in:
Thomas Basler 2023-03-30 22:11:20 +02:00
parent 041249523e
commit d099bc4ff8

View File

@ -100,7 +100,7 @@ float StatisticsParser::getChannelFieldValue(ChannelType_t type, ChannelNum_t ch
}
result /= static_cast<float>(div);
if (setting != NULL) {
if (setting != NULL && _statisticLength > 0) {
result += setting->offset;
}
return result;