Fix: toInfo could be null (#2154)

* validate if txInfo is defined

* set toInfo as optional
This commit is contained in:
nicolas 2021-04-12 04:45:59 -03:00 committed by GitHub
parent 70983c6c01
commit 228ab703ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ type BaseCustom = {
dataSize: string dataSize: string
value: string value: string
isCancellation: boolean isCancellation: boolean
toInfo: AddressInfo toInfo?: AddressInfo
} }
type Custom = BaseCustom & { type Custom = BaseCustom & {

View File

@ -33,7 +33,7 @@ const DetailsWithTxInfo = ({ children, txData, txInfo }: DetailsWithTxInfoProps)
let name let name
let avatarUrl let avatarUrl
if (isCustomTxInfo(txInfo)) { if (isCustomTxInfo(txInfo) && txInfo.toInfo) {
name = txInfo.toInfo.name name = txInfo.toInfo.name
avatarUrl = txInfo.toInfo.logoUri avatarUrl = txInfo.toInfo.logoUri
} }