summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-08 16:02:00 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-08 16:02:00 +0100
commit35c6dceee0d5be651b7241ac505710df0b2020c8 (patch)
tree6051f78def95fa6b151b5ed53cf0899b3a533d29 /Applications/FileManager
parentc4937f01d8fbd329683360bedd2a9b6029456a39 (diff)
downloadserenity-35c6dceee0d5be651b7241ac505710df0b2020c8.zip
FileManager: Don't crash if pressing Return with no selected item.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/DirectoryTableModel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Applications/FileManager/DirectoryTableModel.cpp b/Applications/FileManager/DirectoryTableModel.cpp
index 550ed4598e..c8166ac256 100644
--- a/Applications/FileManager/DirectoryTableModel.cpp
+++ b/Applications/FileManager/DirectoryTableModel.cpp
@@ -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()) {