File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ std::vector<std::string> Files::FetchFileNames(std::string path)
117117 ChangePath ();
118118
119119 std::vector<std::string> files;
120+ if (!ExistsPath (path))
121+ return files;
122+ if (!IsDirectory (path))
123+ return files;
124+
120125 for (const auto &entry : std::filesystem::directory_iterator (path))
121126 {
122127 if (entry.is_directory ())
@@ -136,6 +141,11 @@ std::vector<std::string> Files::FetchDirectories(std::string path)
136141 ChangePath ();
137142
138143 std::vector<std::string> directories;
144+ if (!ExistsPath (path))
145+ return directories;
146+ if (!IsDirectory (path))
147+ return directories;
148+
139149 for (const auto &entry : std::filesystem::directory_iterator (path))
140150 if (entry.is_directory ())
141151 directories.push_back (entry.path ().string ());
You can’t perform that action at this time.
0 commit comments