Remove storage snapshots from list if we can't decrypt them

This commit is contained in:
Torsten Grote 2021-06-22 11:39:39 -03:00 committed by Chirayu Desai
parent 26e35e1820
commit 781bcd28d3

View file

@ -68,10 +68,14 @@ internal class Restore(
snapshot = snapshotRetriever.getSnapshot(streamKey, oldItem.storedSnapshot) snapshot = snapshotRetriever.getSnapshot(streamKey, oldItem.storedSnapshot)
) )
} catch (e: Exception) { } catch (e: Exception) {
Log.e("TAG", "Error retrieving snapshot ${oldItem.time}", e) Log.e("TAG", "Error retrieving snapshot X ${oldItem.time}", e)
continue null
}
if (item == null) {
iterator.remove() // remove the failing item from the list
} else {
iterator.set(item) // replace old item with new item
} }
iterator.set(item)
emit(SnapshotResult.Success(ArrayList(list))) emit(SnapshotResult.Success(ArrayList(list)))
} }
} }