File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ class _JoinForm extends StatelessWidget {
418
418
onPressed: () async {
419
419
final result = await QrCodeScanner .scan (context);
420
420
421
- if (context.mounted) {
421
+ if (context.mounted && result != null ) {
422
422
_handleJoinUrl (context, result);
423
423
}
424
424
},
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ class QrCodeScanner extends StatefulWidget {
13
13
@override
14
14
State <QrCodeScanner > createState () => _QrCodeScannerState ();
15
15
16
- static Future <String > scan (BuildContext context) async {
16
+ static Future <String ? > scan (BuildContext context) async {
17
17
final result = await Navigator .push (
18
18
context,
19
19
MaterialPageRoute <String >(builder: (_) => const QrCodeScanner ()),
20
20
);
21
- return result! ;
21
+ return result;
22
22
}
23
23
}
24
24
You can’t perform that action at this time.
0 commit comments