diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-26 00:59:37 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-26 00:59:37 +0100 |
commit | 51a3f204452ba01a3caacb303eeb1b0f80f2b1a0 (patch) | |
tree | e380a39285a5d8b9d07f223fb2c50ea231061897 | |
parent | d77f8ba413db1141f5893f70b3c43346646575ce (diff) | |
download | serenity-51a3f204452ba01a3caacb303eeb1b0f80f2b1a0.zip |
FileManager: Don't crash when clicking on a forbidden directory.
-rw-r--r-- | Applications/FileManager/DirectoryView.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Applications/FileManager/DirectoryView.cpp b/Applications/FileManager/DirectoryView.cpp index e7cff999f5..87b5a3cc9c 100644 --- a/Applications/FileManager/DirectoryView.cpp +++ b/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) |