Accept non-string type in getAccount error
This commit is contained in:
parent
b859384035
commit
652d377f1d
@ -154,8 +154,8 @@ export class CosmWasmClient {
|
||||
try {
|
||||
const account = await this.forceGetQueryClient().auth.account(searchAddress);
|
||||
return account ? accountFromAny(account) : null;
|
||||
} catch (error) {
|
||||
if (typeof error === "string" && /rpc error: code = NotFound/i.test(error)) {
|
||||
} catch (error: any) {
|
||||
if (/rpc error: code = NotFound/i.test(error.toString())) {
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
|
||||
@ -214,8 +214,8 @@ export class StargateClient {
|
||||
try {
|
||||
const account = await this.forceGetQueryClient().auth.account(searchAddress);
|
||||
return account ? accountFromAny(account) : null;
|
||||
} catch (error) {
|
||||
if (typeof error === "string" && /rpc error: code = NotFound/i.test(error)) {
|
||||
} catch (error: any) {
|
||||
if (/rpc error: code = NotFound/i.test(error.toString())) {
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user