From c23f1eda935a514b886b79f85ce0dab3080c33ef Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 30 Jun 2024 16:57:16 +1200 Subject: Fix crash when loading a directory containing weird entries It was previously assumed that every entry in a directory would be either a file or a directory, but a non-file and non-directory entry has been encountered in the wild. In this case, just ignore the file, leaving it out of the directory listing. --- src/devices/file/directory_listing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/devices/file/directory_listing.rs b/src/devices/file/directory_listing.rs index 9d538bd..0709fc3 100644 --- a/src/devices/file/directory_listing.rs +++ b/src/devices/file/directory_listing.rs @@ -41,7 +41,7 @@ impl DirectoryListing { } else if metadata.is_dir() { EntryType::Directory } else { - unreachable!(); + continue; }, } ) } -- cgit v1.2.3-70-g09d2