mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-01-13 12:11:50 +00:00
fix: not correctly returning bad result for failed zone loading
This commit is contained in:
@@ -7,7 +7,9 @@
|
|||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <format>
|
#include <format>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using namespace std::string_literals;
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
result::Expected<std::unique_ptr<Zone>, std::string> ZoneLoading::LoadZone(const std::string& path,
|
result::Expected<std::unique_ptr<Zone>, std::string> ZoneLoading::LoadZone(const std::string& path,
|
||||||
@@ -41,5 +43,9 @@ result::Expected<std::unique_ptr<Zone>, std::string> ZoneLoading::LoadZone(const
|
|||||||
auto loadedZone = zoneLoader->LoadZone(file);
|
auto loadedZone = zoneLoader->LoadZone(file);
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
if (!loadedZone)
|
||||||
|
return result::Unexpected("Loading zone failed."s);
|
||||||
|
|
||||||
return std::move(loadedZone);
|
return std::move(loadedZone);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user