From 762075d5976f9fc0e27274423a92b89ff199b0ab Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Sun, 1 Jul 2018 17:30:42 +0200
Subject: [PATCH] [fix] sync: did not work with duniter-ui on a brand new
 install

---
 app/lib/system/directory.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/lib/system/directory.ts b/app/lib/system/directory.ts
index cabd6322f..f30eec2e4 100644
--- a/app/lib/system/directory.ts
+++ b/app/lib/system/directory.ts
@@ -61,7 +61,10 @@ class QioFileSystem implements FileSystem {
     return this.qio.remove(file)
   }
 
-  async fsList(dir: string) {
+  async fsList(dir: string): Promise<string[]> {
+    if (!(await this.qio.exists(dir))) {
+      return []
+    }
     return this.qio.list(dir)
   }
 
-- 
GitLab