Skip to content

Commit 0f271f3

Browse files
authored
issue#3481 ignore missing debugInfo (#3482)
1 parent 3bd995b commit 0f271f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/less/tree/debug-info.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ const debugInfo = (context, ctx, lineSeparator) => {
1616
return result;
1717
};
1818

19-
debugInfo.asComment = ctx => `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\n`;
19+
debugInfo.asComment = ctx => ctx.debugInfo ? `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\n` : '';
2020

2121
debugInfo.asMediaQuery = ctx => {
22+
if (!ctx.debugInfo) { return ''; }
2223
let filenameWithProtocol = ctx.debugInfo.fileName;
2324
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
2425
filenameWithProtocol = `file://${filenameWithProtocol}`;

0 commit comments

Comments
 (0)