From a09df566f259955024bd2e7e6441edad9afe3dd2 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 30 Mar 2022 14:36:52 +0100 Subject: [PATCH] ignore backup files of length 0, fix #1593 --- backup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backup.js b/backup.js index 75e236049..8a894666e 100644 --- a/backup.js +++ b/backup.js @@ -79,7 +79,9 @@ function bangleUpload() { .then(() => file.async("string")) .then(data => { console.log("decoded", path); - if (path.startsWith(BACKUP_STORAGEFILE_DIR)) { + if (data.length==0) { // https://github.com/espruino/BangleApps/issues/1593 + console.log("Can't restore files of length 0, ignoring "+path); + } else if (path.startsWith(BACKUP_STORAGEFILE_DIR)) { path = path.substr(BACKUP_STORAGEFILE_DIR.length+1); cmds += AppInfo.getStorageFileUploadCommands(path, data)+"\n"; } else if (!path.includes("/")) {