Skip to content

Commit

Permalink
Merge pull request Marklogic-retired#128 in PROD/explorer-ui from ~SV…
Browse files Browse the repository at this point in the history
…ISHAKA/explorer-ui:dhfprod3629 to develop

* commit '3d905fe4f5c47193e459acbb9ca299e36f440e28':
  fix for undefined
  • Loading branch information
Bruce An authored and Bruce An committed Nov 12, 2019
2 parents e035985 + 3d905fe commit 35ef3f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/search-result/search-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ const SearchResult: React.FC<Props> = (props) => {
}

if (itemEntityProperties.length && entityDef.primaryKey) {
primaryKeyValue = encodeURIComponent(itemEntityProperties[0][entityDef.primaryKey]);
if(Array.isArray(itemEntityProperties[0]) && itemEntityProperties[0].length){
primaryKeyValue = encodeURIComponent(props.item.uri);
}
else{
primaryKeyValue = encodeURIComponent(itemEntityProperties[0][entityDef.primaryKey]);
}
}

function getSnippet() {
Expand Down

0 comments on commit 35ef3f9

Please sign in to comment.