!260 opendir返回值判空

Merge pull request !260 from liduo/fix_warning60
This commit is contained in:
openharmony_ci
2025-09-10 13:51:06 +00:00
committed by Gitee
+3
View File
@@ -84,6 +84,9 @@ const vector<unique_ptr<FileEntry>> FileEntry::GetChilds() const
FindClose(handle);
#else
DIR *handle = opendir(filePath.c_str());
if (handle == nullptr) {
return children;
}
struct dirent *entry;
while ((entry = readdir(handle)) != nullptr) {
string filename(entry->d_name);