Skip to content

Commit

Permalink
[less mode] Fix null dereference bug
Browse files Browse the repository at this point in the history
Issue #1926
  • Loading branch information
peterkroon authored and marijnh committed Nov 4, 2013
1 parent 36b887d commit 464dd7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mode/less/less.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ CodeMirror.defineMode("less", function(config) {
stream.eatWhile(/[\a-zA-Z0-9\-_]/);
if(stream.peek() === " ")stream.eatSpace();
if(stream.peek() === ")" || type === ":")return ret("number", "unit");//rgba(0,0,0,.25);
else if(state.stack[state.stack.length-1] === "rule" && stream.peek().match(/{|,|\+|\(/) === null)return ret("number", "unit");
else if(stream.peek() !== undefined ){
if(state.stack[state.stack.length-1] === "rule" && stream.peek().match(/{|,|\+|\(/) === null)return ret("number", "unit");
}
return ret("tag", "tag");
} else if (ch == "#") {
//we don't eat white-space, we want the hex color and or id only
Expand Down

0 comments on commit 464dd7b

Please sign in to comment.