From 61e3ed9c797ee65b550ba93bef435f090a83d05a Mon Sep 17 00:00:00 2001 From: Inkman007 Date: Wed, 24 Jun 2026 21:57:28 +0000 Subject: [PATCH] fix(573): guard wallet null assertion in MultiSigSetup validateSigners 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. --- src/components/Wallet/MultiSigSetup.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Wallet/MultiSigSetup.tsx b/src/components/Wallet/MultiSigSetup.tsx index d0a41c59..381afa0e 100644 --- a/src/components/Wallet/MultiSigSetup.tsx +++ b/src/components/Wallet/MultiSigSetup.tsx @@ -68,11 +68,12 @@ export default function MultiSigSetup({ } function validateSigners(): string | null { + if (!wallet) return null; for (const s of signers) { if (!s.publicKey.trim()) return 'All signers must have a public key.'; if (!s.publicKey.startsWith('G') || s.publicKey.length !== 56) return `"${s.publicKey.slice(0, 12)}…" is not a valid Stellar public key (must start with G, 56 chars).`; - if (s.publicKey === wallet!.publicKey) + if (s.publicKey === wallet.publicKey) return "Don't add your own key as a co-signer — adjust the master weight instead."; if (s.weight < 0 || s.weight > 255) return 'Signer weight must be between 0 and 255.'; }