From 2a9130653246e0cbcf6d3cd8d81edad610c76d23 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Fri, 26 Jul 2024 20:46:44 +0200 Subject: [PATCH] minor --- lib/widgets/explorer/explorer_page.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/widgets/explorer/explorer_page.dart b/lib/widgets/explorer/explorer_page.dart index a414a8d95..bd7c801fc 100644 --- a/lib/widgets/explorer/explorer_page.dart +++ b/lib/widgets/explorer/explorer_page.dart @@ -55,7 +55,7 @@ class _ExplorerPageState extends State { void initState() { super.initState(); final path = widget.path; - if (path != null) { + if (path != null && androidFileUtils.getStorageVolume(path) != null) { _goTo(path); } else { final primaryVolume = _volumes.firstWhereOrNull((v) => v.isPrimary); @@ -241,8 +241,11 @@ class _ExplorerPageState extends State { } void _goTo(String path) { - _directory.value = androidFileUtils.relativeDirectoryFromPath(path)!; - _updateContents(); + final dir = androidFileUtils.relativeDirectoryFromPath(path); + if (dir != null) { + _directory.value = dir; + _updateContents(); + } } void _updateContents() {