FileManager: Don't crash if pressing Return with no selected item.

This commit is contained in:
Andreas Kling 2019-03-08 16:02:00 +01:00
parent c4937f01d8
commit 35c6dceee0
Notes: sideshowbarker 2024-07-19 15:07:14 +09:00

View File

@ -204,6 +204,8 @@ void DirectoryTableModel::open(const String& a_path)
void DirectoryTableModel::activate(const GModelIndex& index)
{
if (!index.is_valid())
return;
auto& entry = this->entry(index.row());
FileSystemPath path(String::format("%s/%s", m_path.characters(), entry.name.characters()));
if (entry.is_directory()) {