Skip to content

Commit f22f89b

Browse files
fix security risk, remove risky fallback to empty string mnemonic
1 parent 2f36a32 commit f22f89b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/context/WalletContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const WalletProvider: React.FC<{ children: ReactNode }> = ({
215215
const addAccount = async (name: string | null): Promise<void> => {
216216
try {
217217
const index = walletList.length;
218-
const address = HDWallet.fromMnemonic(seedPhrase || "")
218+
const address = HDWallet.fromMnemonic(seedPhrase!)
219219
.deriveAccountAtIndex(index)
220220
.getAddress();
221221

@@ -280,7 +280,7 @@ export const WalletProvider: React.FC<{ children: ReactNode }> = ({
280280
};
281281

282282
const getAccountFromIndex = (index: number): Account => {
283-
return HDWallet.fromMnemonic(seedPhrase || "").deriveAccountAtIndex(index);
283+
return HDWallet.fromMnemonic(seedPhrase!).deriveAccountAtIndex(index);
284284
};
285285

286286
const setSeedPhrase = (seedPhrase: string): void => {

0 commit comments

Comments
 (0)