Skip to content

Commit

Permalink
catch invalid license value
Browse files Browse the repository at this point in the history
  • Loading branch information
NickJ202 committed Aug 14, 2024
1 parent 0b982e0 commit bad3a20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/views/Asset/AssetInfo/AssetInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export default function AssetInfo(props: IProps) {
const licenseElement = props.asset.data.udl[licenseKey];

if (typeof licenseElement === 'object') {
console.log(licenseElement);
return (
<GS.DrawerContentDetail>
{splitTagValue(licenseElement.value)}{' '}
{licenseElement.value ? splitTagValue(licenseElement.value) : '-'}{' '}
{props.asset.data.udl.currency &&
currenciesReducer &&
currenciesReducer[props.asset.data.udl.currency] &&
Expand All @@ -57,7 +58,7 @@ export default function AssetInfo(props: IProps) {
</GS.DrawerContentDetail>
);
} else if (checkValidAddress(licenseElement)) {
return <TxAddress address={licenseElement} wrap={false} />;
return licenseElement ? <TxAddress address={licenseElement} wrap={false} /> : '-';
} else {
return <GS.DrawerContentDetail>{licenseElement}</GS.DrawerContentDetail>;
}
Expand Down Expand Up @@ -143,7 +144,7 @@ export default function AssetInfo(props: IProps) {
content={
<GS.DrawerContent>
<GS.DrawerContentDetail>
<Link to={`${URLS.collection}${props.asset.data.collectionId}`}>
<Link to={URLS.collectionAssets(props.asset.data.collectionId)}>
{props.asset.data.collectionName
? cleanTagValue(props.asset.data.collectionName)
: props.asset.data.collectionId}
Expand Down

0 comments on commit bad3a20

Please sign in to comment.