Skip to content

Commit 334e8b3

Browse files
committed
chore: remove extra if checks and add null check
1 parent e630a30 commit 334e8b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/auth/amplify_auth_cognito_dart/lib/src/state/machines/sign_in_state_machine.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,16 +661,14 @@ final class SignInStateMachine
661661
// Exclude MfaType.sms from consideration
662662
final mfaTypesForSetup = allowedMfaTypes?.difference({MfaType.sms});
663663
if (allowedMfaTypes == null ||
664-
allowedMfaTypes.isEmpty ||
665-
mfaTypesForSetup == null ||
666-
mfaTypesForSetup.isEmpty) {
664+
allowedMfaTypes.isEmpty) {
667665
throw const InvalidUserPoolConfigurationException(
668666
'No eligible MFA types are allowed for setup.',
669667
recoverySuggestion: 'Check your user pool MFA configuration.',
670668
);
671669
}
672670

673-
if (mfaTypesForSetup.length == 1) {
671+
if (mfaTypesForSetup!.length == 1) {
674672
final mfaType = mfaTypesForSetup.first;
675673
if (mfaType == MfaType.totp) {
676674
_enableMfaType = MfaType.totp;

0 commit comments

Comments
 (0)