From 3e5ecf7a6d7ed6996eb62a8cfb4849e7556cec99 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Wed, 25 Sep 2024 15:23:58 -0400 Subject: Fix bad any cast on mac --- collaboration.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'collaboration.cpp') diff --git a/collaboration.cpp b/collaboration.cpp index f3bb242e..f154865a 100644 --- a/collaboration.cpp +++ b/collaboration.cpp @@ -2221,18 +2221,13 @@ std::string AnalysisMergeConflict::GetPathItem(const std::string& p template <> nlohmann::json AnalysisMergeConflict::GetPathItem(const std::string& path) { - std::any anyVal = GetPathItem(path); - try - { - return std::any_cast(anyVal); - } - catch (const std::exception& e) - { - throw SyncException(fmt::format( - "Failed to cast merge conflict path item \"{}\" from \"{}\" to \"{}\": {}", - path, anyVal.type().name(), typeid(nlohmann::json).name(), e.what() - )); - } + char* val = BNAnalysisMergeConflictGetPathItemSerialized(m_object, path.c_str()); + if (val == nullptr) + throw SyncException(fmt::format("Failed to find merge conflict path item \"{}\"", path)); + + std::string strVal = val; + BNFreeString(val); + return nlohmann::json::parse(strVal); } -- cgit v1.3.1