[tesla] Prevent NPE (#10872)

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer 2021-06-15 23:47:47 +02:00 committed by GitHub
parent 54d88a84ce
commit f506ec299b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -560,7 +560,9 @@ public class TeslaVehicleHandler extends BaseThingHandler {
}
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);
if (eventClient != null) {
eventClient.close();
}
} else if ((System.currentTimeMillis() - apiIntervalTimestamp) > 1000
* TeslaAccountHandler.API_ERROR_INTERVAL_SECONDS) {
logger.trace("Resetting the error counter. ({} errors in the last interval)", apiIntervalErrors);