Skip to content

Commit

Permalink
[tesla] Prevent NPE (openhab#10872)
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer authored and computergeek1507 committed Jul 13, 2021
1 parent 078fe66 commit 816c948
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ protected boolean checkResponse(Response response, boolean immediatelyFail) {
}

updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);
eventClient.close();
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);
Expand Down

0 comments on commit 816c948

Please sign in to comment.