fix: check if cache exists before removing it

This commit is contained in:
tdurieux
2023-02-16 08:15:21 +01:00
parent 2a5f22a483
commit 2b10b10207
+2
View File
@@ -295,8 +295,10 @@ export default class Repository {
* @returns * @returns
*/ */
async removeCache() { async removeCache() {
if (await storage.exists(this._model.repoId + "/")) {
return storage.rm(this._model.repoId + "/"); return storage.rm(this._model.repoId + "/");
} }
}
/** /**
* Compute the size of the repository in term of storage and number of files. * Compute the size of the repository in term of storage and number of files.