mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 09:56:23 +03:00
Show error message on invalid QR code.
This commit is contained in:
parent
d59cb0f9cd
commit
01cc8aa6f7
@ -70,7 +70,13 @@ Future<void> handleUri(
|
||||
OathState? state,
|
||||
AppLocalizations l10n,
|
||||
) async {
|
||||
List<CredentialData> creds = CredentialData.fromUri(Uri.parse(qrData));
|
||||
List<CredentialData> creds;
|
||||
try {
|
||||
creds = CredentialData.fromUri(Uri.parse(qrData));
|
||||
} catch (_) {
|
||||
showMessage(context, l10n.l_invalid_qr);
|
||||
return;
|
||||
}
|
||||
if (creds.isEmpty) {
|
||||
showMessage(context, l10n.l_qr_not_found);
|
||||
} else if (creds.length == 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user