mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 13:02:28 +00:00
FileManager: Don't crash if pressing Return with no selected item.
This commit is contained in:
parent
c4937f01d8
commit
35c6dceee0
Notes:
sideshowbarker
2024-07-19 15:07:14 +09:00
Author: https://github.com/awesomekling
Commit: 35c6dceee0
1 changed files with 2 additions and 0 deletions
|
@ -204,6 +204,8 @@ void DirectoryTableModel::open(const String& a_path)
|
||||||
|
|
||||||
void DirectoryTableModel::activate(const GModelIndex& index)
|
void DirectoryTableModel::activate(const GModelIndex& index)
|
||||||
{
|
{
|
||||||
|
if (!index.is_valid())
|
||||||
|
return;
|
||||||
auto& entry = this->entry(index.row());
|
auto& entry = this->entry(index.row());
|
||||||
FileSystemPath path(String::format("%s/%s", m_path.characters(), entry.name.characters()));
|
FileSystemPath path(String::format("%s/%s", m_path.characters(), entry.name.characters()));
|
||||||
if (entry.is_directory()) {
|
if (entry.is_directory()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue