Permalink
Browse files

Don't log response when undefined

  • Loading branch information...
1 parent 215ca7f commit 65b290c10c8c4adbbca9de4eb77f1bb40f67a10c @isaacs isaacs committed Nov 15, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/utils/registry/get.js
View
10 lib/utils/registry/get.js
@@ -24,10 +24,12 @@ function get (project, version, cb) {
etag = data._etag
}
GET(uri, etag, function (er, remoteData, raw, response) {
- log.verbose([response.statusCode, response.headers], "get cb")
- if (response.statusCode === 304 && etag) {
- remoteData = data
- log.verbose("from cache", "etag")
+ if (response) {
+ log.verbose([response.statusCode, response.headers], "get cb")
+ if (response.statusCode === 304 && etag) {
+ remoteData = data
+ log.verbose("from cache", "etag")
+ }
}
data = remoteData
if (er) return cb(er, data)

0 comments on commit 65b290c

Please sign in to comment.