From 0f271f38454f60f6ee0039ab5b0cbb4173a41cfa Mon Sep 17 00:00:00 2001 From: 5UtJAjiRWj1q <55706547+5UtJAjiRWj1q@users.noreply.github.com> Date: Tue, 5 May 2020 04:26:18 +0200 Subject: [PATCH] issue#3481 ignore missing debugInfo (#3482) --- lib/less/tree/debug-info.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/less/tree/debug-info.js b/lib/less/tree/debug-info.js index 096386d11..71424c8dd 100644 --- a/lib/less/tree/debug-info.js +++ b/lib/less/tree/debug-info.js @@ -16,9 +16,10 @@ const debugInfo = (context, ctx, lineSeparator) => { return result; }; -debugInfo.asComment = ctx => `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\n`; +debugInfo.asComment = ctx => ctx.debugInfo ? `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\n` : ''; debugInfo.asMediaQuery = ctx => { + if (!ctx.debugInfo) { return ''; } let filenameWithProtocol = ctx.debugInfo.fileName; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { filenameWithProtocol = `file://${filenameWithProtocol}`;