2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-01-13 20:21:48 +00:00

fix: not correctly returning bad result for failed zone loading

This commit is contained in:
Jan Laupetin
2026-01-09 18:18:18 +00:00
parent 4048de44a1
commit 055c950e63

View File

@@ -7,7 +7,9 @@
#include <filesystem>
#include <format>
#include <fstream>
#include <string>
using namespace std::string_literals;
namespace fs = std::filesystem;
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);
file.close();
if (!loadedZone)
return result::Unexpected("Loading zone failed."s);
return std::move(loadedZone);
}