Skip to content
Browse files

Guard against empty dir stack returning undefined.

  • Loading branch information...
1 parent c1c92e9 commit 7ba66c3a5b21483243bc1f5835d65ecdb6cf9cd4 @tobie committed May 2, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 assets/modulr.js
  2. +1 −1 assets/modulr.sync.js
View
2 assets/modulr.js
@@ -103,7 +103,7 @@ var modulr = (function(global) {
if (!RELATIVE_IDENTIFIER_PATTERN.test(identifier)) {
return identifier;
}
- dir = _dirStack[_dirStack.length - 1]
+ dir = _dirStack[_dirStack.length - 1] || '';
parts = (dir + identifier).split('/');
path = [];
for (var i = 0, length = parts.length; i < length; i++) {
View
2 assets/modulr.sync.js
@@ -85,7 +85,7 @@ var require = (function() {
if (!RELATIVE_IDENTIFIER_PATTERN.test(identifier)) {
return identifier;
}
- dir = _dirStack[_dirStack.length - 1]
+ dir = _dirStack[_dirStack.length - 1] || '';
parts = (dir + identifier).split('/');
path = [];
for (var i = 0, length = parts.length; i < length; i++) {

0 comments on commit 7ba66c3

Please sign in to comment.
Something went wrong with that request. Please try again.