Skip to content

Commit

Permalink
Fix issue with undefined passed to findEntityEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Feb 28, 2021
1 parent 4f9c20b commit 0367aad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-whois",
"version": "0.0.4",
"version": "0.0.5",
"description": "Perform RDAP/WHOIS lookups over HTTP",
"main": "src/index.js",
"keywords": [],
Expand Down
4 changes: 3 additions & 1 deletion src/rdap.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const findAbuseEmail = data => {
const registrarEntities = findEntities('registrar', data);
if (!registrarEntities) return;

return findEntityEmail('abuse', { entities: registrarEntities.map(entity => entity.entities).flat(1) });
return findEntityEmail('abuse', {
entities: registrarEntities.map(entity => entity.entities).flat(1).filter(entity => entity !== undefined),
});
};

module.exports = async query => {
Expand Down

0 comments on commit 0367aad

Please sign in to comment.