Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Don't throw when the data is null. Instead, just let the thing respon…
Browse files Browse the repository at this point in the history
…d with the error
  • Loading branch information
isaacs committed May 3, 2010
1 parent 47bd133 commit 8f20337
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/registry.js
Expand Up @@ -92,7 +92,7 @@ function GET (where, cb) {
ex.message += "\n" + data
return cb(ex, data, response)
}
if (data.error) return cb(new Error(
if (data && data.error) return cb(new Error(
data.error + (" "+data.reason || "")))
cb(null, data, response)
})
Expand Down Expand Up @@ -132,7 +132,7 @@ function PUT (where, what, cb) {
ex.message += "\n" + data
return cb(ex, data, response)
}
if (data.error) return cb(new Error(
if (data && data.error) return cb(new Error(
data.error + (" "+data.reason || "")))
cb(null, data, response)
})
Expand Down

0 comments on commit 8f20337

Please sign in to comment.