From 4b6cdaf90b485a7b599dcca992fbcf32a546cc04 Mon Sep 17 00:00:00 2001 From: abstract829 Date: Tue, 30 Jul 2024 13:43:33 -0400 Subject: [PATCH] fix(contracts): set wrappedContract undefined if not found --- packages/contracts/src/useRegisteredContract.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/contracts/src/useRegisteredContract.tsx b/packages/contracts/src/useRegisteredContract.tsx index 24a84be..23a79aa 100644 --- a/packages/contracts/src/useRegisteredContract.tsx +++ b/packages/contracts/src/useRegisteredContract.tsx @@ -81,7 +81,10 @@ export const useWrappedContract = ( ) useEffect(() => { - if (!deploymentInfo) return + if (!deploymentInfo) { + setwWrappedContract(undefined) + return + } const newWrappedContract: WrappedContract = { deploymentInfo,