Skip to content

Commit

Permalink
Merge pull request #1350 from zhx828/oncokb-fix
Browse files Browse the repository at this point in the history
OncoKB: Return original string if string cannot be converted to refComponent
Former-commit-id: ecca724
  • Loading branch information
zhx828 authored Aug 6, 2018
2 parents 4834be1 + 4ee4b04 commit 0b54337
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shared/components/annotation/OncoKbCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,13 @@ export default class OncoKbCard extends React.Component<OncoKbCardProps>
const parts = str.split(/pmid|nct/i);

if (parts.length < 2) {
return null;
return str;
}

const ids = parts[1].match(/[0-9]+/g);

if (!ids) {
return null;
return str;
}

let baseUrl:string|undefined;
Expand Down Expand Up @@ -551,7 +551,7 @@ export default class OncoKbCard extends React.Component<OncoKbCardProps>
);
}
else {
return null;
return str;
}
}

Expand All @@ -577,7 +577,7 @@ export default class OncoKbCard extends React.Component<OncoKbCardProps>
// if delimiter convert to a JSX component
if(part.match(regex))
{
let component:JSX.Element|null = this.refComponent(part, type);
let component:JSX.Element|string = this.refComponent(part, type);

if (component) {
content.push(component);
Expand Down

0 comments on commit 0b54337

Please sign in to comment.