Skip to content

Commit

Permalink
issue#3481 ignore missing debugInfo (#3482)
Browse files Browse the repository at this point in the history
  • Loading branch information
5UtJAjiRWj1q committed May 5, 2020
1 parent 3bd995b commit 0f271f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/less/tree/debug-info.js
Expand Up @@ -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}`;
Expand Down

0 comments on commit 0f271f3

Please sign in to comment.