Browse Source

fix: send message back on parseScript error

Gerald 8 years ago
parent
commit
6c8ee5930a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/background/utils/db.js

+ 1 - 1
src/background/utils/db.js

@@ -532,7 +532,7 @@ export function getExportData(ids, withValues) {
 export function parseScript(data) {
   const { id, code, message, isNew, config, custom } = data;
   const meta = parseMeta(code);
-  if (!meta.name) throw i18n('msgInvalidScript');
+  if (!meta.name) return Promise.reject(i18n('msgInvalidScript'));
   const result = {
     cmd: 'UpdateScript',
     data: {