Remove storage snapshots from list if we can't decrypt them
This commit is contained in:
parent
26e35e1820
commit
781bcd28d3
1 changed files with 7 additions and 3 deletions
|
@ -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)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue