Skip to content

Commit c07448c

Browse files
committed
Fix popping when there is no entries in sub-router
1 parent adde731 commit c07448c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

auto_route/lib/src/router/controller/routing_controller.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,7 @@ abstract class StackRouter extends RoutingController {
11461146
@optionalTypeArgs
11471147
Future<bool> maybePop<T extends Object?>([T? result]) async {
11481148
final NavigatorState? navigator = _navigatorKey.currentState;
1149-
if (navigator == null) return SynchronousFuture<bool>(false);
1150-
if (await navigator.maybePop<T>(result)) {
1149+
if (await navigator?.maybePop<T>(result) ?? false) {
11511150
return true;
11521151
} else if (_parent != null) {
11531152
return _parent!.maybePop<T>(result);

0 commit comments

Comments
 (0)