ignore backup files of length 0, fix #1593

pull/1639/head
Gordon Williams 2022-03-30 14:36:52 +01:00
parent c3dc1ed885
commit a09df566f2
1 changed files with 3 additions and 1 deletions

View File

@ -79,7 +79,9 @@ function bangleUpload() {
.then(() => file.async("string")) .then(() => file.async("string"))
.then(data => { .then(data => {
console.log("decoded", path); 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); path = path.substr(BACKUP_STORAGEFILE_DIR.length+1);
cmds += AppInfo.getStorageFileUploadCommands(path, data)+"\n"; cmds += AppInfo.getStorageFileUploadCommands(path, data)+"\n";
} else if (!path.includes("/")) { } else if (!path.includes("/")) {