From 77357ff71ac144f553bbd390c6f2585d7ad9da9d Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 5 Sep 2016 23:29:06 +0100 Subject: 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. --- backends/networking/sdl_net/handlerutils.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'backends/networking') diff --git a/backends/networking/sdl_net/handlerutils.cpp b/backends/networking/sdl_net/handlerutils.cpp index 121fd1a77e..73ddf9e83f 100644 --- a/backends/networking/sdl_net/handlerutils.cpp +++ b/backends/networking/sdl_net/handlerutils.cpp @@ -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; + } } } -- cgit v1.2.3