From 4bd2084ba7b23327c26a2d8b24dc4169c14bfa17 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 28 Jul 2018 19:41:07 +0900 Subject: Error on console --- src/background/controllers/command.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/background/controllers') diff --git a/src/background/controllers/command.js b/src/background/controllers/command.js index 41057e0..befab42 100644 --- a/src/background/controllers/command.js +++ b/src/background/controllers/command.js @@ -48,6 +48,10 @@ export default class CommandController { let trimmed = line.trimStart(); let words = trimmed.split(/ +/); let name = words[0]; + if (words[0].length === 0) { + return Promise.resolve(); + } + let keywords = trimmed.slice(name.length).trimStart(); switch (words[0]) { case 'o': @@ -85,5 +89,6 @@ export default class CommandController { case 'set': return this.commandIndicator.set(keywords); } + throw new Error(words[0] + ' command is not defined'); } } -- cgit v1.2.3