From be8a45751ce4ef82523dbd765e33ba353d1f0458 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Mon, 24 May 2021 04:02:03 +0800 Subject: [PATCH] Make album repo optional in remove Useful when removing data files --- lib/use_case/remove.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/use_case/remove.dart b/lib/use_case/remove.dart index ff1b4262..87f1247a 100644 --- a/lib/use_case/remove.dart +++ b/lib/use_case/remove.dart @@ -14,7 +14,10 @@ class Remove { /// Remove a file Future call(Account account, File file) async { await fileRepo.remove(account, file); - await _cleanUpAlbums(account, file); + if (albumRepo != null) { + _log.info("[call] Skip albums cleanup as albumRepo == null"); + await _cleanUpAlbums(account, file); + } KiwiContainer().resolve().fire(FileRemovedEvent(account, file)); }