From 02a3300f25e796749d920e237f978c87c2a12bfd Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Feb 2017 02:16:30 +0900 Subject: [PATCH] Fix bug --- src/common/text/elements/code.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/text/elements/code.js b/src/common/text/elements/code.js index 456fe83f47..c3a3e86dd0 100644 --- a/src/common/text/elements/code.js +++ b/src/common/text/elements/code.js @@ -221,7 +221,9 @@ const elements = [ // label code => { if (code[0] != '@') return null; - const label = code.match(/^@([a-zA-Z_-]+?)\n/)[0]; + const match = code.match(/^@([a-zA-Z_-]+?)\n/); + if (!match) return null; + const label = match[0]; return { html: `${label}`, next: label.length