Skip to content

Commit

Permalink
Fix #89 - test for almost empty query from EuPMC
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrow committed Apr 22, 2016
1 parent 949a6a2 commit e3f9049
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 @@ -61,8 +61,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 e3f9049

Please sign in to comment.