diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt index 82a3952d3e..e10778bfbd 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt @@ -311,7 +311,7 @@ internal class OlmMachine( DeviceLists(deviceChanges?.changed.orEmpty(), deviceChanges?.left.orEmpty()) val adapter = MoshiProvider.providesMoshi().adapter(ToDeviceSyncResponse::class.java) - val events = toDevice?.let { adapter.toJson(it) } ?: "[]" + val events = adapter.toJson(toDevice ?: ToDeviceSyncResponse())!! adapter.fromJson(inner.receiveSyncChanges(events, devices, counts)) ?: ToDeviceSyncResponse() }