Don't crash on empty directories.

This commit is contained in:
2026-10-31 18:14:53 -04:00
parent 52fe05e3e4
commit 72a29fb175
+1 -1
View File
@@ -56,7 +56,7 @@ getEntries( const std::filesystem::path where )
if( entry.is_directory() ) return Entry::Directory;
return Entry::Normal;
};
entries.push_back( Entry{ entry.path().filename(), drwx( entry, type ), type == Entry::Normal ? get_file_size( entry.path() ) : 0,
entries.push_back( Entry{ entry.path().filename(), drwx( entry, type ), type == Entry::Directory ? 0 : get_file_size( entry.path() ),
static_cast< int >( ymd.year() ), static_cast< unsigned >( ymd.month() ), static_cast< unsigned >( ymd.day() ),
time_of_day.hours().count(), time_of_day.minutes().count(),
type, is_exe( entry ) } );