diff --git a/lib/models/code.dart b/lib/models/code.dart index 89e10d947..36a564d80 100644 --- a/lib/models/code.dart +++ b/lib/models/code.dart @@ -115,7 +115,12 @@ class Code { } static Type _getType(Uri uri) { - return uri.host == "totp" ? Type.totp : Type.hotp; + if (uri.host == "totp") { + return Type.totp; + } else if (uri.host == "hotp") { + return Type.hotp; + } + throw UnsupportedError("Unsupported format with host ${uri.host}"); } @override