From 31d37c88327d2437cd6f759e2a5c11dbfbe69764 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Fri, 16 Nov 2018 09:33:09 -0600 Subject: [PATCH] Only update originalMd5 for valid styles --- background/update.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/background/update.js b/background/update.js index c4ae8d5a..fbe03fdf 100644 --- a/background/update.js +++ b/background/update.js @@ -156,8 +156,14 @@ } // USO can't handle POST requests for style json return download(style.updateUrl, {body: null}) - // USO may not provide a correctly updated originalMd5 (#555) - .then(text => Object.assign(tryJSONparse(text || '{}'), {originalMd5: md5})); + .then(text => { + const style = tryJSONparse(text); + if (style) { + // USO may not provide a correctly updated originalMd5 (#555) + style.originalMd5 = md5; + } + return style; + }); }); }