Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Error on broken JSON in package.json files

  • Loading branch information...
commit f468af84e604d0036dbfeb6b31ca7b40cdac8e8b 1 parent de14e7c
@isaacs isaacs authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 fstream-npm.js
View
8 fstream-npm.js
@@ -171,7 +171,13 @@ Packer.prototype.readRules = function (buf, e) {
return Ignore.prototype.readRules.call(this, buf, e)
}
- var p = this.package = JSON.parse(buf.toString())
+ try {
+ var p = this.package = JSON.parse(buf.toString())
+ } catch (er) {
+ er.file = path.resolve(this.path, e)
+ this.error(er)
+ return
+ }
if (this === this.root) {
this.bundleLinks = this.bundleLinks || {}
Please sign in to comment.
Something went wrong with that request. Please try again.