From 450984abf3b76761e9a2c56ed1cba53f9cf4fbbb Mon Sep 17 00:00:00 2001 From: eight Date: Mon, 9 Sep 2019 12:48:44 +0800 Subject: [PATCH] Fix: don't assign undefined to style object (#764) --- js/usercss.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/usercss.js b/js/usercss.js index deebcbbb..85937ec6 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -43,7 +43,9 @@ const usercss = (() => { style.usercssData = metadata; // https://github.com/openstyles/stylus/issues/560#issuecomment-440561196 for (const [key, value] of Object.entries(GLOBAL_METAS)) { - style[value || key] = metadata[key]; + if (metadata[key] !== undefined) { + style[value || key] = metadata[key]; + } } return style; });