Handle invalid json
Merge pull request #2 from euank/master

Handle invalid json