From aab843597db36ac98de0fb65861c4c0854ddac70 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 6 Mar 2017 22:20:51 -0800 Subject: [PATCH] UI/updater: Fix potential fail case when no files to patch The updater would return HTTP 400 on an empty json array upload for the patch manifest. --- UI/win-update/updater/updater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UI/win-update/updater/updater.cpp b/UI/win-update/updater/updater.cpp index 65339b169..23409d39f 100644 --- a/UI/win-update/updater/updater.cpp +++ b/UI/win-update/updater/updater.cpp @@ -1086,7 +1086,8 @@ static bool Update(wchar_t *cmdLine) * Send file hashes */ string newManifest; - { + + if (json_array_size(files) > 0) { char *post_body = json_dumps(files, JSON_COMPACT); int responseCode; @@ -1117,6 +1118,8 @@ static bool Update(wchar_t *cmdLine) responseCode); return false; } + } else { + newManifest = "[]"; } /* ------------------------------------- *