code review

This commit is contained in:
Valere 2021-11-25 16:56:46 +01:00
parent fbe098f54b
commit 893e6e3962

View file

@ -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()
}