From 9be2f942c74a4ff5fd0d15c4d75d33ada177827b Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 4 Jan 2018 16:41:55 +0300 Subject: [PATCH] restore default template on saving empty code fixes 3418ac9c --- background/usercss-helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/background/usercss-helper.js b/background/usercss-helper.js index dd7d61d5..274ff37c 100644 --- a/background/usercss-helper.js +++ b/background/usercss-helper.js @@ -62,7 +62,8 @@ } function save(style) { - if (!style.sourceCode) { + // restore if stripped by getStyleWithNoCode + if (typeof style.sourceCode !== 'string') { style.sourceCode = cachedStyles.byId.get(style.id).sourceCode; } return buildMeta(style)