0xMiden / 0xMiden/wallet-adapter

WalletModal can crash when no wallet adapters are available

Open Beginner friendly
#105 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2
Forks
9
Avg merge
25m
Merged PRs (30d)
1

Description

`WalletModal` assumes there is always at least one wallet adapter available when no installed wallets are present.

Evidence in `packages/ui/src/WalletModal.tsx`:
- `getStartedWallet` falls back to `otherWallets[0]!` when there are no installed wallets and the Bread wallet adapter is not found.
- The empty-installed-wallet render path then reads `getStartedWallet.adapter.url` for the Chrome badge link.

If a consumer renders the modal with an empty `wallets` array, or with a set of adapters that does not include the Bread wallet and produces no loadable/not-detected fallback, `getStartedWallet` can be `undefined` at runtime and the modal crashes instead of rendering a stable empty state.

This should be guarded so the modal handles an empty wallet list without throwing.

Contributor guide

Open the contributing guide

Research direction

The issue is in `packages/ui/src/WalletModal.tsx`. Look for the `getStartedWallet` logic and the render path for empty installed wallets. Add a guard to check if `getStartedWallet` is defined before accessing its `adapter.url` property. Test by rendering the modal with an empty `wallets` array to ensure it shows a stable empty state without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.