diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-08 16:02:00 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-08 16:02:00 +0100 |
commit | 35c6dceee0d5be651b7241ac505710df0b2020c8 (patch) | |
tree | 6051f78def95fa6b151b5ed53cf0899b3a533d29 /Applications/FileManager | |
parent | c4937f01d8fbd329683360bedd2a9b6029456a39 (diff) | |
download | serenity-35c6dceee0d5be651b7241ac505710df0b2020c8.zip |
FileManager: Don't crash if pressing Return with no selected item.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r-- | Applications/FileManager/DirectoryTableModel.cpp | 2 |
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()) { |