raise err when collection is missing from cache
This commit is contained in:
parent
683fb1bb49
commit
8fb2307fa0
2 changed files with 5 additions and 3 deletions
|
@ -213,6 +213,9 @@ class CollectionsService {
|
|||
Uint8List getCollectionKey(int collectionID) {
|
||||
if (!_cachedKeys.containsKey(collectionID)) {
|
||||
final collection = _collectionIDToCollections[collectionID];
|
||||
if (collection == null) {
|
||||
throw AssertionError('collectionID $collectionID is not cached');
|
||||
}
|
||||
_cachedKeys[collectionID] = _getDecryptedKey(collection);
|
||||
}
|
||||
return _cachedKeys[collectionID];
|
||||
|
@ -458,8 +461,6 @@ class CollectionsService {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _validateMoveRequest(
|
||||
int toCollectionID, int fromCollectionID, List<File> files) {
|
||||
if (toCollectionID == fromCollectionID) {
|
||||
|
|
|
@ -286,7 +286,8 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
|
|||
final dialog = createProgressDialog(context, "restoring files...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await CollectionsService.instance.restore(toCollectionID, widget.selectedFiles.files?.toList());
|
||||
await CollectionsService.instance
|
||||
.restore(toCollectionID, widget.selectedFiles.files?.toList());
|
||||
RemoteSyncService.instance.sync(silently: true);
|
||||
widget.selectedFiles?.clearAll();
|
||||
await dialog.hide();
|
||||
|
|
Loading…
Add table
Reference in a new issue