Fix potential deadlock listing albums

This commit is contained in:
Ming Ming 2021-07-19 01:16:57 +08:00
parent 0e8a461a0f
commit 7d078b5a8d

View file

@ -37,12 +37,13 @@ class ListAlbum {
File( File(
path: remote_storage_util.getRemoteAlbumsDir(account), path: remote_storage_util.getRemoteAlbumsDir(account),
)); ));
} catch (e) { } catch (e, stacktrace) {
if (e is ApiException && e.response.statusCode == 404) { if (e is ApiException && e.response.statusCode == 404) {
// no albums // no albums
return; return;
} }
rethrow; yield Tuple2(e, stacktrace);
return;
} }
final albumFiles = final albumFiles =
ls.where((element) => element.isCollection != true).toList(); ls.where((element) => element.isCollection != true).toList();