From c9227fd8acb50021f87cc927aad70c2259c4ed49 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Thu, 23 Sep 2021 00:05:03 +0200 Subject: [PATCH] Added safty check so that Google sync does not fail --- .../src/se/hal/plugin/assistant/google/SmartHomeImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java b/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java index ff331b04..cde8a85c 100644 --- a/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java +++ b/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java @@ -115,6 +115,11 @@ public class SmartHomeImpl extends SmartHomeApp implements OAuth2TokenRegistrati DeviceType type = DeviceType.getType(device); DeviceTrait[] traits = DeviceTraitFactory.getTraits(device); + if (type == null) { + logger.warning("DeviceType returned null for Hal device(" + device.getDeviceConfig() + "): " + device); + continue; + } + // Generate payload SyncResponse.Payload.Device.Builder deviceBuilder =