From 3660721c24a1e4284fddfbc5da85147f0fe4478d Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Mon, 29 Apr 2019 09:38:55 -0300 Subject: [PATCH] default null to addr zero --- app/components/EthAddress.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/EthAddress.jsx b/app/components/EthAddress.jsx index cd89430..71d1e79 100644 --- a/app/components/EthAddress.jsx +++ b/app/components/EthAddress.jsx @@ -46,7 +46,7 @@ class EthAddress extends React.Component { componentDidUpdate(prevProps, prevState) { if (prevProps.value != this.props.value && this.props.value != this.state.value) { this.setState({value: this.props.value}); - } + } } onKeyPress(event) { @@ -101,7 +101,7 @@ class EthAddress extends React.Component { blockyScale, control } = this.props; - const { value } = this.state; + const value = this.state.value ? this.state.value : "0x0000000000000000000000000000000000000000"; let valid = /^(0x)?[0-9a-f]{40}$/i.test(value); const colorStyle = colors && valid ? { backgroundImage: `linear-gradient(90deg, #${value.substr(6, 6)} 0% 15%, #${value.substr(12, 6)} 17% 32%, #${value.substr(18, 6)} 34% 49%, #${value.substr(24, 6)} 51% 66%, #${value.substr(30, 6)} 68% 83%, #${value.substr(36, 6)} 85% 100%)`