aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/file/search_manager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp
index 1a6a96ec6d..30c269c290 100644
--- a/engines/zvision/file/search_manager.cpp
+++ b/engines/zvision/file/search_manager.cpp
@@ -265,13 +265,14 @@ void SearchManager::addDir(const Common::String &name) {
void SearchManager::listDirRecursive(Common::List<Common::String> &_list, const Common::FSNode &fsNode, int depth) {
Common::FSList fsList;
- fsNode.getChildren(fsList);
+ if ( fsNode.getChildren(fsList) ) {
- _list.push_back(fsNode.getPath());
+ _list.push_back(fsNode.getPath());
- if (depth > 1)
- for (Common::FSList::const_iterator it = fsList.begin(); it != fsList.end(); ++it)
- listDirRecursive(_list, *it, depth - 1);
+ if (depth > 1)
+ for (Common::FSList::const_iterator it = fsList.begin(); it != fsList.end(); ++it)
+ listDirRecursive(_list, *it, depth - 1);
+ }
}
} // End of namespace ZVision