diff --git a/pushnotifications/src/main/java/com/pusher/pushnotifications/api/PushNotificationsAPI.kt b/pushnotifications/src/main/java/com/pusher/pushnotifications/api/PushNotificationsAPI.kt index f2cd0ce..2e1e978 100644 --- a/pushnotifications/src/main/java/com/pusher/pushnotifications/api/PushNotificationsAPI.kt +++ b/pushnotifications/src/main/java/com/pusher/pushnotifications/api/PushNotificationsAPI.kt @@ -146,6 +146,9 @@ class PushNotificationsAPI(private val instanceId: String, overrideHostURL: Stri val responseBody = response.body() if (responseBody != null && response.code() in 200..299) { + if (responseBody.initialInterestSet==null || responseBody.id==null){ + throw PushNotificationsAPIException("device id or initial interests is null") + } return RegisterDeviceResult( deviceId = responseBody.id, initialInterests = responseBody.initialInterestSet)