aboutsummaryrefslogtreecommitdiff
path: root/common/fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/fs.cpp')
-rw-r--r--common/fs.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/fs.cpp b/common/fs.cpp
index d8f065b449..f7edf41711 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -62,10 +62,10 @@ bool FilesystemNode::exists() const {
}
FilesystemNode FilesystemNode::getChild(const Common::String &n) const {
- if (_realNode == 0)
- return *this;
+ // If this node is invalid or not a directory, return an invalid node
+ if (_realNode == 0 || !_realNode->isDirectory())
+ return FilesystemNode();
- assert(_realNode->isDirectory());
AbstractFilesystemNode *node = _realNode->getChild(n);
return FilesystemNode(node);
}