diff --git a/lib/libimhex/source/helpers/semantic_version.cpp b/lib/libimhex/source/helpers/semantic_version.cpp index 688b0208c..3df1c1ac6 100644 --- a/lib/libimhex/source/helpers/semantic_version.cpp +++ b/lib/libimhex/source/helpers/semantic_version.cpp @@ -39,15 +39,27 @@ namespace hex { } u32 SemanticVersion::major() const { - return std::stoul(m_parts[0]); + try { + return std::stoul(m_parts[0]); + } catch (...) { + return 0; + } } u32 SemanticVersion::minor() const { - return std::stoul(m_parts[1]); + try { + return std::stoul(m_parts[1]); + } catch (...) { + return 0; + } } u32 SemanticVersion::patch() const { - return std::stoul(m_parts[2]); + try { + return std::stoul(m_parts[2]); + } catch (...) { + return 0; + } } bool SemanticVersion::nightly() const {