From 2abbf670d875b3249b6963115d03285aca3d44f9 Mon Sep 17 00:00:00 2001 From: eight Date: Wed, 26 Sep 2018 10:37:14 +0800 Subject: [PATCH] Fix: check err.code --- edit/source-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edit/source-editor.js b/edit/source-editor.js index 28ec7f49..e14f74a9 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -215,7 +215,7 @@ function createSourceEditor(style) { }) .catch(err => { if (err.handled) return; - if (err.message === t('styleMissingMeta', 'name')) { + if (err.code === 'missingMandatory' && err.args.includes('name')) { messageBox.confirm(t('usercssReplaceTemplateConfirmation')).then(ok => ok && chromeSync.setLZValue('usercssTemplate', code) .then(() => chromeSync.getLZValue('usercssTemplate'))