diff options
author | Max Horn | 2008-09-07 21:47:01 +0000 |
---|---|---|
committer | Max Horn | 2008-09-07 21:47:01 +0000 |
commit | abffd3b3ab0d4c0af833696da3bcc819b2bf6aa8 (patch) | |
tree | 5b9d38ccb15249088652187b0a1fa6591294ce49 /common/fs.cpp | |
parent | 7aaf6139e25b55d4eca335553fe6da654ba1b341 (diff) | |
download | scummvm-rg350-abffd3b3ab0d4c0af833696da3bcc819b2bf6aa8.tar.gz scummvm-rg350-abffd3b3ab0d4c0af833696da3bcc819b2bf6aa8.tar.bz2 scummvm-rg350-abffd3b3ab0d4c0af833696da3bcc819b2bf6aa8.zip |
Allow invoking FilesystemNode::getChild on non-dir nodes, by returning an invalid node in that case
svn-id: r34429
Diffstat (limited to 'common/fs.cpp')
-rw-r--r-- | common/fs.cpp | 6 |
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); } |