From 5f118e00cbbf65c631cd6c0b40561959af8798c8 Mon Sep 17 00:00:00 2001 From: Valtteri Karesto Date: Mon, 11 Apr 2022 11:46:49 +0300 Subject: [PATCH] Added error check --- state/actions/importAccount.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/state/actions/importAccount.ts b/state/actions/importAccount.ts index 4fa5fec..2223e97 100644 --- a/state/actions/importAccount.ts +++ b/state/actions/importAccount.ts @@ -16,7 +16,11 @@ export const importAccount = (secret: string) => { try { account = derive.familySeed(secret); } catch (err: any) { - toast.error(err.message) + if (err?.message) { + toast.error(err.message) + } else { + toast.error('Error occured while importing account') + } return; } if (!account || !account.secret.familySeed) {