Skip to content

fix(#573): Guard null assertion crash risk in MultiSigSetup.tsx#634

Merged
llinsss merged 1 commit into
DogStark:mainfrom
Inkman007:fix/573-multisig-null-guard
Jun 25, 2026
Merged

fix(#573): Guard null assertion crash risk in MultiSigSetup.tsx#634
llinsss merged 1 commit into
DogStark:mainfrom
Inkman007:fix/573-multisig-null-guard

Conversation

@Inkman007

Copy link
Copy Markdown
Contributor

Summary

  • Adds an explicit if (!wallet) return null guard at the top of validateSigners() so the function is self-contained and safe
  • Removes the unsafe wallet!.publicKey non-null assertion; wallet.publicKey is now used after the guard narrows the type
  • The existing early-return at render time already prevents the form rendering when wallet is null; this fix covers the inner validation function as well

Changes

  • src/components/Wallet/MultiSigSetup.tsx — added null guard in validateSigners(), removed ! assertion on line ~75

Test plan

  • Render MultiSigSetup with wallet={null} — placeholder renders, no crash
  • Render with a valid wallet and attempt to add the wallet's own public key as co-signer — correct validation error fires
  • TypeScript compiler reports no errors on the modified file

Closes #573

Adds an explicit null check at the top of validateSigners() so TypeScript
no longer relies on the non-null assertion operator and a crash cannot
occur if the function is ever invoked before the wallet is available.
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Inkman007 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@llinsss llinsss merged commit f26dc40 into DogStark:main Jun 25, 2026
5 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Fix Non-Null Assertion Crash Risk in Wallet/MultiSigSetup.tsx

2 participants