Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't log response when undefined

  • Loading branch information...
commit 65b290c10c8c4adbbca9de4eb77f1bb40f67a10c 1 parent 215ca7f
isaacs isaacs authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/utils/registry/get.js
10 lib/utils/registry/get.js
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.