diff --git a/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx b/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx index 283c8dc53..b2e2a43ce 100644 --- a/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx +++ b/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx @@ -17,11 +17,13 @@ export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({ SwapFormKey.ToChain, SwapFormKey.ToToken, ]); - setValue(SwapFormKey.FromChain, toChain); - setValue(SwapFormKey.FromToken, toToken); - setValue(SwapFormKey.ToChain, fromChain); - setValue(SwapFormKey.ToToken, fromToken); - setValue(SwapFormKey.FromAmount, ''); + if (fromChain && fromToken && toChain && toToken) { + setValue(SwapFormKey.FromAmount, ''); + setValue(SwapFormKey.FromChain, toChain); + setValue(SwapFormKey.FromToken, toToken); + setValue(SwapFormKey.ToChain, fromChain); + setValue(SwapFormKey.ToToken, fromToken); + } }; return (