Skip to content

Commit

Permalink
fix: Error retrieving entity from whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus Seijas committed Jul 15, 2019
1 parent 83bd4a9 commit 2654b65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ner/ner-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ class NerManager {
if (witelistMap) {
edges = edges.map(item => {
const edge = item;
edge.entity = witelistMap[item.entity].shift() || item.entity;
if (witelistMap[item.entity]) {
edge.entity = witelistMap[item.entity].shift() || item.entity;
} else {
edge.entity = item.entity;
}
return edge;
});
}
Expand Down

0 comments on commit 2654b65

Please sign in to comment.