From 9e28b04e334bfd98f955228570cebd7a3a0a343f Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Wed, 31 May 2023 12:09:41 +0200 Subject: [PATCH] add try-catch --- libsrc/core/version.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsrc/core/version.hpp b/libsrc/core/version.hpp index 0e5a1777..92cbb6b8 100644 --- a/libsrc/core/version.hpp +++ b/libsrc/core/version.hpp @@ -18,6 +18,7 @@ namespace ngcore VersionInfo() = default; VersionInfo(std::string vstring) { + try { minor_ = release = patch = 0; git_hash = ""; if(vstring.substr(0,1) == "v") @@ -49,6 +50,9 @@ namespace ngcore } } } + } + catch (std::invalid_argument&) + {} } VersionInfo(const char* cstr) : VersionInfo(std::string(cstr)) { }