diff --git a/src/entsoe/EntsoeApi.cpp b/src/entsoe/EntsoeApi.cpp index b8b7fe0c..a7e38990 100644 --- a/src/entsoe/EntsoeApi.cpp +++ b/src/entsoe/EntsoeApi.cpp @@ -61,7 +61,7 @@ float EntsoeApi::getValueForHour(time_t cur, int8_t hour) { if(tomorrow == NULL) return ENTSOE_NO_VALUE; value = tomorrow->getPoint(pos-24); - if(strcmp(tomorrow->getMeasurementUnit(), "MWH") == 0) { + if(value != ENTSOE_NO_VALUE && strcmp(tomorrow->getMeasurementUnit(), "MWH") == 0) { multiplier *= 0.001; } else { return ENTSOE_NO_VALUE; @@ -73,7 +73,7 @@ float EntsoeApi::getValueForHour(time_t cur, int8_t hour) { if(today == NULL) return ENTSOE_NO_VALUE; value = today->getPoint(pos); - if(strcmp(today->getMeasurementUnit(), "MWH") == 0) { + if(value != ENTSOE_NO_VALUE && strcmp(today->getMeasurementUnit(), "MWH") == 0) { multiplier *= 0.001; } else { return ENTSOE_NO_VALUE;