From 42e97ef1532a4937e545ea7e0b7c5325066af62a Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 25 Sep 2018 20:45:07 +0800 Subject: [PATCH] Fix: display error on install page --- install-usercss/install-usercss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index 663b40ec..755d3308 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -242,7 +242,7 @@ const contents = Array.isArray(err) ? [$create('pre', err.join('\n'))] : [err && err.message && $create('pre', err.message) || err || 'Unknown error']; - if (Number.isInteger(err.index)) { + if (Number.isInteger(err.index) && typeof contents[0] === 'string') { const pos = cm.posFromIndex(err.index); contents[0] = `${pos.line + 1}:${pos.ch + 1} ` + contents[0]; contents.push($create('pre', drawLinePointer(pos)));