Permalink
Browse files

Don't crash when JSON is incorrect

  • Loading branch information...
1 parent 04537b9 commit dd4111aa4806d319f636585ac44359e2c5e2a661 @zefhemel zefhemel committed Jun 1, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 plugins-server/cloud9.ide.revisions/revisions.js
@@ -200,9 +200,14 @@ require("util").inherits(RevisionsPlugin, Plugin);
Async.forEachSeries(lines,
function(line, next) {
- if (line) {
- var revision = JSON.parse(line);
- revObj[revision.ts] = revision;
+ try {
+ if (line) {
+ var revision = JSON.parse(line);
+ revObj[revision.ts] = revision;
+ }
+ }
+ catch(e) {
+ console.error("Revision JSON Parse error", e.message, line);
}
next();
},

0 comments on commit dd4111a

Please sign in to comment.