tezos advanced new wallet null error fix
What changed, and why it matters
This commit fixes a bug when creating a new Tezos wallet in Stack Wallet. For certain coins that don't support an extra passphrase and have multiple possible recovery-phrase lengths, the app was leaving the passphrase value as null, which could cause a crash or error. The fix treats Tezos the same as a few other coins by setting the passphrase to an empty string instead of null. The rest of the changes are minor code formatting.
Review whether other coins with hasMnemonicPassphraseSupport == false and multiple possibleMnemonicLengths need the same empty-string fallback, to avoid similar null errors. No immediate security patch appears necessary beyond this bug fix.
Security signals we found
Null-value handling bug in wallet creation flow
Crash/error in new wallet generation for Tezos
Missing initialization of mnemonicPassphrase for coins with multiple possibleMnemonicLengths and no passphrase support
Evidence from the diff
In new_wallet_recovery_phrase_warning_view.dart, the code assigns a mnemonic passphrase. For coins without mnemonic passphrase support and with multiple possibleMnemonicLengths, the variable could remain null. The patch adds Tezos to the existing list (Epiccash, Mimblewimblecoin, Solana) that explicitly sets mnemonicPassphrase = “”. This prevents a null error during Tezos advanced new-wallet creation. The remaining diff is whitespace/formatting only.
Changed components
lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dartTezos wallet creation flowMnemonic/passphrase handling logicInspect captured patch +17 / −19
### lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart
@@ -199,8 +199,12 @@ class _NewWalletRecoveryPhraseWarningViewState
.mnemonicPassphrase;
} else {
// this may not be epiccash and sol specific?
+ // tezos as well (and probably other coins with
+ // `bool get hasMnemonicPassphraseSupport => false;` when they have
+ // multiple values in `possibleMnemonicLengths`.
if (coin is Epiccash ||
coin is Mimblewimblecoin ||
+ coin is Tezos ||
coin is Solana) {
mnemonicPassphrase = "";
}
@@ -287,15 +291,14 @@ class _NewWalletRecoveryPhraseWarningViewState
right: 10,
),
child: AppBarIconButton(
- semanticsLabel:
- "Question Button. Opens A Dialog For Recovery Phrase Explanation.",
+ semanticsLabel: "Question Button. Opens A Dialog For Recovery Phrase Explanation.",
icon: SvgPicture.asset(
Assets.svg.circleQuestion,
width: 20,
height: 20,
- color: Theme.of(
- context,
- ).extension<StackColors>()!.accentColorDark,
+ color: Theme.of(context)
+ .extension<StackColors>()!
+ .accentColorDark,
),
onPressed: () async {
await showDialog<void>(
@@ -331,9 +334,8 @@ class _NewWalletRecoveryPhraseWarningViewState
Text(
walletName,
textAlign: TextAlign.center,
- style: STextStyles.label(
- context,
- ).copyWith(fontSize: 12),
+ style: STextStyles.label(context)
+ .copyWith(fontSize: 12),
),
if (!isDesktop) const SizedBox(height: 4),
Text(
@@ -362,9 +364,8 @@ class _NewWalletRecoveryPhraseWarningViewState
? STextStyles.desktopTextMediumRegular(
context,
)
- : STextStyles.subtitle(
- context,
- ).copyWith(fontSize: 12),
+ : STextStyles.subtitle(context)
+ .copyWith(fontSize: 12),
)
: Column(
children: [
@@ -381,13 +382,11 @@ class _NewWalletRecoveryPhraseWarningViewState
RichText(
textAlign: TextAlign.center,
text: TextSpan(
- style: STextStyles.desktopH3(
- context,
- ).copyWith(fontSize: 18),
+ style: STextStyles.desktopH3(context)
+ .copyWith(fontSize: 18),
children: [
TextSpan(
- text:
- "On the next screen you will be given ",
+ text: "On the next screen you will be given ",
style: STextStyles.desktopH3(context)
.copyWith(
color: Theme.of(context)
@@ -597,9 +596,8 @@ class _NewWalletRecoveryPhraseWarningViewState
? STextStyles.desktopTextMedium(
context,
)
- : STextStyles.baseXS(
- context,
- ).copyWith(height: 1.3),
+ : STextStyles.baseXS(context)
+ .copyWith(height: 1.3),
),
),
],Why this scored 26/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.