From da2b26299d211eb52622fbc0af85ece9e1c2cc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 13 Dec 2013 16:09:09 +0100 Subject: [PATCH] Allow calling getFilesInDir with null files --- file/file_util.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file/file_util.cpp b/file/file_util.cpp index 7cbe7a3c06..250413bebf 100644 --- a/file/file_util.cpp +++ b/file/file_util.cpp @@ -316,7 +316,8 @@ size_t getFilesInDir(const char *directory, std::vector *files, const } } - files->push_back(info); + if (files) + files->push_back(info); #ifdef _WIN32 } while (FindNextFile(hFind, &ffd) != 0); FindClose(hFind); @@ -324,7 +325,8 @@ size_t getFilesInDir(const char *directory, std::vector *files, const } closedir(dirp); #endif - std::sort(files->begin(), files->end()); + if (files) + std::sort(files->begin(), files->end()); return foundEntries; }