From beec95ca1a69fedfae5c7373a6d6e8d88079967a Mon Sep 17 00:00:00 2001 From: "Chiaki.C" Date: Wed, 10 Jan 2024 10:16:53 +0800 Subject: [PATCH] fix: catch evm send editor error --- src/components/EvmEditors/EvmTxForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/EvmEditors/EvmTxForm.tsx b/src/components/EvmEditors/EvmTxForm.tsx index 9260169..5ae0cf3 100644 --- a/src/components/EvmEditors/EvmTxForm.tsx +++ b/src/components/EvmEditors/EvmTxForm.tsx @@ -34,7 +34,11 @@ const EvmTxForm = ({ sendObj.to = toString; } if (valueString) { - sendObj.value = web3.utils.toHex(valueString); + try { + sendObj.value = web3.utils.toHex(valueString); + } catch (e) { + setValue(""); + } } if (dataString) { sendObj.data = dataString;