Browse files

Cannot call method 'match' of undefined

  • Loading branch information...
1 parent 5d7ea52 commit fbaabc9a75ac1080c0ab12332a1a5bb07fd57497 @isaacs isaacs committed Aug 21, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 models/package.js
View
3 models/package.js
@@ -15,7 +15,8 @@ var LRU = require("lru-cache")
function urlPolicy (u) {
u = url.parse(u)
if (!u) return null
- if (u.protocol === 'http:' && u.hostname.match(/gravatar.com$/)) {
+ if (u.protocol === 'http:' &&
+ (u.hostname && u.hostname.match(/gravatar.com$/))) {
// use encrypted gravatars
return url.format('https://secure.gravatar.com' + u.pathname)
}

0 comments on commit fbaabc9

Please sign in to comment.