Skip to content

Commit 8074de7

Browse files
authored
core/v2.0.8: [fix] - Check Before ENS Lookup (#871)
* Add check for chain for rpcUrl requests * Increment version
1 parent 989236f commit 8074de7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.0.7",
3+
"version": "2.0.8",
44
"scripts": {
55
"build": "rollup -c",
66
"dev": "rollup -c -w",

packages/core/src/provider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ export async function getEns(
228228
address: Address,
229229
chain: Chain
230230
): Promise<Ens | null> {
231+
// chain we don't recognize and don't have a rpcUrl for requests
232+
if (!chain) return null
233+
231234
if (!ethersProviders[chain.rpcUrl]) {
232235
ethersProviders[chain.rpcUrl] = new providers.StaticJsonRpcProvider(
233236
chain.rpcUrl
@@ -271,7 +274,7 @@ export async function getBalance(
271274
address: string,
272275
chain: Chain
273276
): Promise<Balances | null> {
274-
// chain we don't recognize
277+
// chain we don't recognize and don't have a rpcUrl for requests
275278
if (!chain) return null
276279

277280
if (!ethersProviders[chain.rpcUrl]) {

0 commit comments

Comments
 (0)