diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/CryptoManager.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/CryptoManager.kt index 2826268392..d7f9777c73 100755 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/CryptoManager.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/CryptoManager.kt @@ -54,6 +54,7 @@ import im.vector.matrix.android.internal.crypto.store.IMXCryptoStore import im.vector.matrix.android.internal.crypto.tasks.* import im.vector.matrix.android.internal.crypto.verification.DefaultSasVerificationService import im.vector.matrix.android.internal.di.MoshiProvider +import im.vector.matrix.android.internal.session.room.members.RoomMembers import im.vector.matrix.android.internal.session.sync.model.SyncResponse import im.vector.matrix.android.internal.task.TaskExecutor import im.vector.matrix.android.internal.task.configureWith diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/live/RealmLiveEncryptionObserver.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/live/RealmLiveEncryptionObserver.kt index 4fd9dc9fb4..bca038d8be 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/live/RealmLiveEncryptionObserver.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/live/RealmLiveEncryptionObserver.kt @@ -41,6 +41,10 @@ internal class RoomEncryptionEnabler(monarchy: Monarchy) : RealmLiveEntityObserv val eventIds = inserted.mapNotNull { it.asDomain().eventId } + if (eventIds.isEmpty()) { + return + } + val workParam = EnableEncryptionWorker.Params(eventIds) val workData = WorkerParamsFactory.toData(workParam)