Skip to content

Commit

Permalink
[2375] Patch a small debug issue in less
Browse files Browse the repository at this point in the history
The getInput() method fails to get the source of the file. This crashes
the error and returns a junk error report. Instead we default to an
empty string.
  • Loading branch information
aron committed May 23, 2012
1 parent 88dfb52 commit f1ca89d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/public/base/test/vendor/less.js
Expand Up @@ -342,15 +342,15 @@ less.Parser = function Parser(env) {

function getInput(e, env) {
if (e.filename && env.filename && (e.filename !== env.filename)) {
return parser.imports.contents[basename(e.filename)];
return parser.imports.contents[basename(e.filename)] || "";
} else {
return input;
}
}

function getLocation(index, input) {
for (var n = index, column = -1;
n >= 0 && input && input.charAt(n) !== '\n';
n >= 0 && input.charAt(n) !== '\n';
n--) { column++ }

return { line: typeof(index) === 'number' ? (input.slice(0, index).match(/\n/g) || "").length : null,
Expand Down

0 comments on commit f1ca89d

Please sign in to comment.