From: Stefan Giehl Date: Tue, 28 Sep 2021 22:09:34 +0000 (+0200) Subject: [Luxtronik] Fix possible out ouf bound error for older heatpumps (#11318) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=ff272bc828b210784ee040564de5b975b7f35b2c;p=openhab-addons.git [Luxtronik] Fix possible out ouf bound error for older heatpumps (#11318) * [Luxtronik] Fix possible out ouf bound error for older heatpumps Signed-off-by: Stefan Giehl * fix typo Signed-off-by: Stefan Giehl --- diff --git a/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/HeatpumpConnector.java b/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/HeatpumpConnector.java index a3ed82e643..1cfd739a2b 100644 --- a/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/HeatpumpConnector.java +++ b/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/HeatpumpConnector.java @@ -71,7 +71,7 @@ public class HeatpumpConnector { // the thermal energies can be unreasonably high in some cases, probably due to a sign bug in the firmware // trying to correct this issue here for (int i = 151; i <= 154; i++) { - if (heatpumpValues[i] >= 214748364) { + if (heatpumpValues.length > i && heatpumpValues[i] >= 214748364) { heatpumpValues[i] -= 214748364; } }