CLOUD: Fix looking for the wwwroot.zip archive

If the themepath was defined but the wwwroot.zip file was not in
that path, looking for it failed as it never reached the part of the
code using SearchMan to look for it.
This commit is contained in:
Thierry Crozat 2016-09-05 23:29:06 +01:00
parent 817211b2ed
commit 77357ff71a

View file

@ -39,15 +39,14 @@ Common::Archive *HandlerUtils::getZipArchive() {
// first search in themepath
if (ConfMan.hasKey("themepath")) {
const Common::FSNode &node = Common::FSNode(ConfMan.get("themepath"));
if (!node.exists() || !node.isReadable() || !node.isDirectory())
return nullptr;
Common::FSNode fileNode = node.getChild(ARCHIVE_NAME);
if (fileNode.exists() && fileNode.isReadable() && !fileNode.isDirectory()) {
Common::SeekableReadStream *const stream = fileNode.createReadStream();
Common::Archive *zipArchive = Common::makeZipArchive(stream);
if (zipArchive)
return zipArchive;
if (node.exists() && node.isReadable() && node.isDirectory()) {
Common::FSNode fileNode = node.getChild(ARCHIVE_NAME);
if (fileNode.exists() && fileNode.isReadable() && !fileNode.isDirectory()) {
Common::SeekableReadStream *const stream = fileNode.createReadStream();
Common::Archive *zipArchive = Common::makeZipArchive(stream);
if (zipArchive)
return zipArchive;
}
}
}