Browse Source

FileManager: Don't crash when clicking on a forbidden directory.

Andreas Kling 6 years ago
parent
commit
51a3f20445
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Applications/FileManager/DirectoryView.cpp

+ 4 - 0
Applications/FileManager/DirectoryView.cpp

@@ -38,6 +38,10 @@ void DirectoryView::open(const String& path)
 {
     if (m_path == path)
         return;
+    DIR* dirp = opendir(path.characters());
+    if (!dirp)
+        return;
+    closedir(dirp);
     m_path = path;
     reload();
     if (on_path_change)