From a47bffdddf4676ef0985346c30ab16b00501f7c9 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 23 Sep 2022 17:17:24 +0200 Subject: [PATCH] Fix `isSafe` util function We were calling `return query?.safe !== null ? true : false` but since `query` can become `undefined` through the optional chaining operator, we were returning `true` if the query wasn't able to retrieve anything. Signed-off-by: Sebastian Martinez --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 29b453ff3..3a869ffa5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -592,7 +592,7 @@ export async function isSafe( addr: address.toLowerCase(), }); - return query?.safe !== null ? true : false; + return Boolean(query?.safe); } // Get a Gnosis Safe at an address.