diff --git a/src/HttpPowerMeter.cpp b/src/HttpPowerMeter.cpp index 94402fad9..798a9a2f8 100644 --- a/src/HttpPowerMeter.cpp +++ b/src/HttpPowerMeter.cpp @@ -16,6 +16,8 @@ void HttpPowerMeterClass::init() float HttpPowerMeterClass::getPower(int8_t phase) { + if (phase < 1 || phase > POWERMETER_MAX_PHASES) { return 0.0; } + return power[phase - 1]; }