From cb2e78b7cbe66152f7f330e7441fa9ae0ba9fd76 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Feb 2017 02:21:46 +0900 Subject: [PATCH] Fix fucking 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 9c0ea8a4fb..6daf141342 100644 --- a/src/common/text/elements/code.js +++ b/src/common/text/elements/code.js @@ -140,7 +140,9 @@ const elements = [ // comment code => { if (code.substr(0, 2) != '//') return null; - const comment = code.match(/^\/\/(.+?)\n/)[0]; + const match = code.match(/^\/\/(.+?)\n/); + if (!match) return null; + const comment = match[0]; return { html: `${escape(comment)}`, next: comment.length