Skip to content

Commit

Permalink
Merge pull request #91 from tarrow/fixEmptyResponseFromEuPMC
Browse files Browse the repository at this point in the history
Fix #89 - test for almost empty query from EuPMC
  • Loading branch information
Richard Smith-Unna committed May 1, 2016
2 parents d6052ba + e3f9049 commit bff5ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/eupmc.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ EuPmc.prototype.completeCallback = function(data) {

var resp = data.responseWrapper;

if(!resp.hitCount[0] || !resp.resultList[0].result) {
log.error("Malformed response from EuropePMC. Try running again.");
if(!resp.hitCount || !resp.hitCount[0] || !resp.resultList[0].result) {
log.error("Malformed or empty response from EuropePMC. Try running again. Perhaps your query is wrong.");
process.exit(1);
}

Expand Down

0 comments on commit bff5ef2

Please sign in to comment.