Browse Source

fix(auth): code display for new codes

Prateek Sunal 1 year ago
parent
commit
54f6f8656d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      auth/lib/onboarding/view/setup_enter_secret_key_page.dart

+ 2 - 1
auth/lib/onboarding/view/setup_enter_secret_key_page.dart

@@ -261,7 +261,8 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
           return;
           return;
         }
         }
       }
       }
-      final CodeDisplay display = widget.code!.display.copyWith(tags: tags);
+      final CodeDisplay display =
+          widget.code?.display.copyWith(tags: tags) ?? CodeDisplay(tags: tags);
       final Code newCode = widget.code == null
       final Code newCode = widget.code == null
           ? Code.fromAccountAndSecret(
           ? Code.fromAccountAndSecret(
               isStreamCode ? Type.steam : Type.totp,
               isStreamCode ? Type.steam : Type.totp,