From accb8d4f893b18086d07bf0b2183e259afb0fbdd Mon Sep 17 00:00:00 2001 From: liduo Date: Fri, 5 Sep 2025 13:54:51 +0800 Subject: [PATCH] =?UTF-8?q?opendir=E8=BF=94=E5=9B=9E=E5=80=BC=E5=88=A4?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liduo --- src/file_entry.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/file_entry.cpp b/src/file_entry.cpp index 6083dec..84fa530 100644 --- a/src/file_entry.cpp +++ b/src/file_entry.cpp @@ -84,6 +84,9 @@ const vector> 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); -- Gitee