diff --git a/lib/models/code.dart b/lib/models/code.dart index 89e10d94730ccc5271b308825a020ffc9581a686..36a564d8054040f1713f534f0cf69e3d5093d8bf 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