diff --git a/lib/widget/category_display.dart b/lib/widget/category_display.dart index c28522ff..d0c883e2 100644 --- a/lib/widget/category_display.dart +++ b/lib/widget/category_display.dart @@ -89,7 +89,11 @@ class _CategoryDisplayState extends RefreshableState { // Update the category if (category != null) { - await category!.reload(); + final bool result = await category?.reload() ?? false; + + if (!result) { + Navigator.of(context).pop(); + } } // Request a list of sub-categories under this one diff --git a/lib/widget/location_display.dart b/lib/widget/location_display.dart index fb88381d..0c2fd3a3 100644 --- a/lib/widget/location_display.dart +++ b/lib/widget/location_display.dart @@ -119,7 +119,11 @@ class _LocationDisplayState extends RefreshableState { // Reload location information if (location != null) { - await location?.reload(); + final bool result = await location?.reload() ?? false; + + if (!result) { + Navigator.of(context).pop(); + } } // Request a list of sub-locations under this one