Added safty check so that Google sync does not fail

This commit is contained in:
Ziver Koc 2021-09-23 00:05:03 +02:00
parent 0b029f68e3
commit c9227fd8ac

View file

@ -115,6 +115,11 @@ public class SmartHomeImpl extends SmartHomeApp implements OAuth2TokenRegistrati
DeviceType type = DeviceType.getType(device); DeviceType type = DeviceType.getType(device);
DeviceTrait[] traits = DeviceTraitFactory.getTraits(device); DeviceTrait[] traits = DeviceTraitFactory.getTraits(device);
if (type == null) {
logger.warning("DeviceType returned null for Hal device(" + device.getDeviceConfig() + "): " + device);
continue;
}
// Generate payload // Generate payload
SyncResponse.Payload.Device.Builder deviceBuilder = SyncResponse.Payload.Device.Builder deviceBuilder =