Skip to content

Commit 83e2deb

Browse files
committed
Merge pull request #29 from joshwnj/fix-url-bug
Fix a bug that sometimes crashes on `url(...)`
2 parents a3024f1 + f3e8826 commit 83e2deb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function localizeDeclNode(node, context) {
155155
}
156156
break;
157157
case "url":
158-
if(context.options.rewriteUrl) {
158+
if(context.options && context.options.rewriteUrl) {
159159
newNode = Object.create(node);
160160
newNode.url = context.options.rewriteUrl(context.global, node.url);
161161
return newNode;

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ test(name, function (t) {
393393
t.plan(tests.length);
394394

395395
tests.forEach(function (testCase) {
396-
var options = testCase.options || {};
396+
var options = testCase.options;
397397
if(testCase.error) {
398398
t.throws(function() {
399399
process(testCase.input, options);

0 commit comments

Comments
 (0)