Skip to content

Commit

Permalink
Do not hang if all cases fall through when parsing response in getRan…
Browse files Browse the repository at this point in the history
…domWords.
  • Loading branch information
jimkang committed Jul 13, 2019
1 parent f1bb797 commit fe97f8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wordnok.js
Expand Up @@ -140,6 +140,8 @@ function createWordnok(opts) {
words = pluck(parseResults.parsed, 'word');
words = words.filter(isCool);
done(error, words);
} else {
done(new Error('getRandomWords could not parse Wordnik reply.'));
}
}
}
Expand Down Expand Up @@ -314,6 +316,9 @@ function createWordnok(opts) {
.filter(definitionIsUsable)
.map(removeDefinitionClassificationPrefix);
}
if (!definitions) {
debugger;
}
done(error, definitions);
}
}
Expand Down

0 comments on commit fe97f8c

Please sign in to comment.