Skip to content

Commit

Permalink
Fix for when there are no color matches: colonMatches will be null an…
Browse files Browse the repository at this point in the history
…d therefore have no length.
  • Loading branch information
misteroneill authored and mhevery committed Jan 17, 2012
1 parent d3dc963 commit 9df720e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jasmine-node/requirejs-runner.js
Expand Up @@ -27,7 +27,7 @@ exports.executeJsRunner = function(specCollection, done, jasmineEnv) {
index = 0,
colonMatches = __dirname.match(/.:/);

for(var i = 0; i < colonMatches.length; i++){
for(var i = 0; i < (colonMatches && colonMatches.length) || 0; i++){
thisDir = thisDir.replace(colonMatches[i], '\\' + colonMatches[i].substring(0,1));
}

Expand Down Expand Up @@ -56,7 +56,7 @@ exports.executeJsRunner = function(specCollection, done, jasmineEnv) {
colonMatches = dir.match(/.:/),
wrappedScript;

for(var i = 0; i < colonMatches.length; i++){
for(var i = 0; i < (colonMatches && colonMatches.length) || 0; i++){
dir = dir.replace(colonMatches[i], '/' + colonMatches[i].substring(0,1));
}

Expand Down

0 comments on commit 9df720e

Please sign in to comment.