mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
Fix IllegalArgumentException (#19662)
Both driveState and chargeState can be null, as indicated by earlier usage of these fields. Signed-off-by: ivan <ivan@caffeinated-consulting.com>
This commit is contained in:
+7
-2
@@ -951,10 +951,15 @@ public class TeslaVehicleHandler extends BaseThingHandler {
|
||||
|
||||
Set<Map.Entry<String, JsonElement>> entrySet = new HashSet<>();
|
||||
|
||||
entrySet.addAll(gson.toJsonTree(driveState, DriveState.class).getAsJsonObject().entrySet());
|
||||
if (driveState != null) {
|
||||
entrySet.addAll(gson.toJsonTree(driveState, DriveState.class).getAsJsonObject().entrySet());
|
||||
}
|
||||
entrySet.addAll(gson.toJsonTree(guiState, GUIState.class).getAsJsonObject().entrySet());
|
||||
entrySet.addAll(gson.toJsonTree(vehicleState, VehicleState.class).getAsJsonObject().entrySet());
|
||||
entrySet.addAll(gson.toJsonTree(chargeState, ChargeState.class).getAsJsonObject().entrySet());
|
||||
if (chargeState != null) {
|
||||
entrySet.addAll(
|
||||
gson.toJsonTree(chargeState, ChargeState.class).getAsJsonObject().entrySet());
|
||||
}
|
||||
entrySet.addAll(gson.toJsonTree(climateState, ClimateState.class).getAsJsonObject().entrySet());
|
||||
entrySet.addAll(
|
||||
gson.toJsonTree(softwareUpdate, SoftwareUpdate.class).getAsJsonObject().entrySet());
|
||||
|
||||
Reference in New Issue
Block a user