Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Added: Error handling while parcing qr code data

Muhammed Ayimenf902c8ca4c16
diff --git a/lib/ui/settings/data/import/analyze_qr_code.dart b/lib/ui/settings/data/import/analyze_qr_code.dart
index fe384d93cc..4f3645d247 100644
--- a/lib/ui/settings/data/import/analyze_qr_code.dart
+++ b/lib/ui/settings/data/import/analyze_qr_code.dart
@@ -76,10 +76,14 @@ class _QrScannerState extends State<QrScanner> {
}
}
HapticFeedback.vibrate();
- List<Code> codes =
- parseGoogleAuth(capture.barcodes[0].rawValue!);
- scannerController.dispose();
- Navigator.of(context).pop(codes);
+ try {
+ List<Code> codes =
+ parseGoogleAuth(capture.barcodes[0].rawValue!);
+ scannerController.dispose();
+ Navigator.of(context).pop(codes);
+ } catch (e) {
+ debugPrint('Error occurred while parsing: $e');
+ }
} else {
showToast(context, l10n.invalidQrCodeText);
isNavigationPerformed = false;