Skip to content

Commit

Permalink
Merge pull request #188 from booleanbetrayal/fix_googlebot_nullref
Browse files Browse the repository at this point in the history
fix: guard against null-refs when parsing Safari user-agents
  • Loading branch information
ocombe committed May 29, 2015
2 parents 9a186c9 + 818aa5d commit 6733616
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ocLazyLoad.loaders.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
} else if(ua.indexOf("android") > -1) { // Android < 4.4
var androidVersion = parseFloat(ua.slice(ua.indexOf("android") + 8));
useCssLoadPatch = androidVersion < 4.4;
} else if(ua.indexOf('safari') > -1 && ua.indexOf('chrome') == -1 && ua.indexOf('phantomjs') == -1) {
var safariVersion = parseFloat(ua.match(/version\/([\.\d]+)/i)[1]);
useCssLoadPatch = safariVersion < 6;
} else if(ua.indexOf('safari') > -1) {
var versionMatch = ua.match(/version\/([\.\d]+)/i);
useCssLoadPatch = (versionMatch && versionMatch[1] && parseFloat(versionMatch[1]) < 6);
}
}

Expand Down

0 comments on commit 6733616

Please sign in to comment.