diff options
-rw-r--r-- | Userland/Libraries/LibGUI/FileSystemModel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index dae02d35b9..9872055acf 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -418,6 +418,12 @@ void FileSystemModel::handle_file_event(Core::FileWatcherEvent const& event) break; } + if (&child.value() == m_root) { + // Root directory of the filesystem model has been removed. All items became invalid. + invalidate(); + break; + } + auto index = child->index(0); begin_delete_rows(index.parent(), index.row(), index.row()); |