Check for toHuman before using (#2571)

This commit is contained in:
Jaco Greeff 2020-04-15 07:30:55 +02:00 committed by GitHub
parent a38a456d34
commit db121c1c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,9 @@ function StaticParam ({ asHex, children, className, defaultValue, label, style }
const value = defaultValue && defaultValue.value && (
asHex
? defaultValue.value.toHex()
: JSON.stringify(defaultValue.value.toHuman(), null, 2).replace(/"/g, '')
: JSON.stringify(
defaultValue.value.toHuman ? defaultValue.value.toHuman() : defaultValue.value, null, 2
).replace(/"/g, '')
);
return (