DIRECTOR: Fix unchecked return value

getChildren returns false when not succesful, i.e. meaning we can bail
out of the loop iteration.

Fixes COVERITY: 1462418
This commit is contained in:
Roland van Laar 2022-10-07 17:05:46 +02:00
parent 891fa08f15
commit 9aafdcf976

View File

@ -421,7 +421,9 @@ bool testPath(Common::String &path, bool directory) {
if (directory_list.empty() && !directory) {
mode = Common::FSNode::kListAll;
}
d.getChildren(fslist, mode);
bool hasChildren = d.getChildren(fslist, mode);
if (!hasChildren)
continue;
bool exists = false;
for (Common::FSList::iterator i = fslist.begin(); i != fslist.end(); ++i) {