fix null check when user exits out of qr code scanner (#2002)

This commit is contained in:
cyan
2025-02-05 03:40:06 +02:00
committed by GitHub
parent e88b6b2bcf
commit 1dc7f9309a
5 changed files with 10 additions and 4 deletions
+2
View File
@@ -100,6 +100,7 @@ class AnimatedURPage extends BasePage {
switch (urQrType) {
case "ur:xmr-txunsigned": // ur:xmr-txsigned
final ur = await presentQRScanner(context);
if (ur == null) return;
final result = await monero!.commitTransactionUR(animatedURmodel.wallet, ur);
if (result) {
Navigator.of(context).pop(true);
@@ -107,6 +108,7 @@ class AnimatedURPage extends BasePage {
break;
case "ur:xmr-output": // xmr-keyimage
final ur = await presentQRScanner(context);
if (ur == null) return;
final result = await monero!.importKeyImagesUR(animatedURmodel.wallet, ur);
if (result) {
Navigator.of(context).pop(true);
+1
View File
@@ -233,6 +233,7 @@ class AddressTextField<T extends Currency> extends StatelessWidget{
await PermissionHandler.checkPermission(Permission.camera, context);
if (!isCameraPermissionGranted) return;
final code = await presentQRScanner(context);
if (code == null) return;
if (code.isEmpty) {
return;
}