Don't crash on empty directories.
This commit is contained in:
@@ -56,7 +56,7 @@ getEntries( const std::filesystem::path where )
|
|||||||
if( entry.is_directory() ) return Entry::Directory;
|
if( entry.is_directory() ) return Entry::Directory;
|
||||||
return Entry::Normal;
|
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() ),
|
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(),
|
time_of_day.hours().count(), time_of_day.minutes().count(),
|
||||||
type, is_exe( entry ) } );
|
type, is_exe( entry ) } );
|
||||||
|
|||||||
Reference in New Issue
Block a user