Skip to content

Commit

Permalink
fix: Don't use 'BuildContext's across async gaps. (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-j-gajjar authored Sep 2, 2023
1 parent 6f9ab23 commit fc8a4fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ui/views/app_selector/app_selector_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ class AppSelectorViewModel extends BaseViewModel {
await DeviceApps.getApp(packageName, true) as ApplicationWithIcon?;
if (app != null) {
if (await checkSplitApk(packageName) && !isRooted) {
return showSelectFromStorageDialog(context);
if (context.mounted) {
return showSelectFromStorageDialog(context);
}
} else if (!await checkSplitApk(packageName) || isRooted) {
selectApp(app);
Navigator.pop(context);
if (context.mounted) {
Navigator.pop(context);
}
}
}
}
Expand Down

0 comments on commit fc8a4fc

Please sign in to comment.