Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3488896
D6396.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6396.diff
View Options
diff --git a/lib/components/ens-cache-provider.react.js b/lib/components/ens-cache-provider.react.js
--- a/lib/components/ens-cache-provider.react.js
+++ b/lib/components/ens-cache-provider.react.js
@@ -14,14 +14,14 @@
);
type Props = {
- +provider: EthersProvider,
+ +provider: ?EthersProvider,
+children: React.Node,
};
function ENSCacheProvider(props: Props): React.Node {
const { provider, children } = props;
const context = React.useMemo(
() => ({
- ensCache: new ENSCache(provider),
+ ensCache: provider ? new ENSCache(provider) : null,
}),
[provider],
);
diff --git a/native/utils/ethers-utils.js b/native/utils/ethers-utils.js
--- a/native/utils/ethers-utils.js
+++ b/native/utils/ethers-utils.js
@@ -13,9 +13,9 @@
alchemyKey = key;
} catch {}
-const provider: EthersProvider = new ethers.providers.AlchemyProvider(
- 'mainnet',
- alchemyKey,
-);
+let provider: ?EthersProvider;
+if (alchemyKey) {
+ provider = new ethers.providers.AlchemyProvider('mainnet', alchemyKey);
+}
export { provider };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 11:05 AM (18 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2677011
Default Alt Text
D6396.diff (1 KB)
Attached To
Mode
D6396: [native] Don't crash if Alchemy API key is missing
Attached
Detach File
Event Timeline
Log In to Comment