fix: prevent identicon error when no address is provided

This commit is contained in:
fernandomg 2020-05-22 16:49:08 -03:00
parent b4a470a770
commit d0dbd8a28c
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
import * as React from 'react'
import { ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses'
import { toDataUrl } from './blockies'
export default class Identicon extends React.PureComponent<any> {
@ -45,7 +47,7 @@ export default class Identicon extends React.PureComponent<any> {
generateBlockieIdenticon = (address, diameter) => {
const image = new window.Image()
image.src = toDataUrl(address)
image.src = toDataUrl(address || ZERO_ADDRESS)
image.height = diameter
image.width = diameter
image.style.borderRadius = `${diameter / 2}px`