From 20a7dc55a00c3680e57b3f5e653e17647168411d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 16 Aug 2020 10:41:10 +0200 Subject: [PATCH] Return a value when stacktrace is empty. --- src/Exception.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Exception.hpp b/src/Exception.hpp index ab381c0..8a9bf05 100644 --- a/src/Exception.hpp +++ b/src/Exception.hpp @@ -37,6 +37,9 @@ namespace ArbUt { [[nodiscard]] std::string GetStacktrace([[maybe_unused]] size_t depth = 6, [[maybe_unused]] bool include_addr = true) const { #if !WINDOWS + if (_stack.size() == 0){ + return "No stack trace could be retrieved."; + } backward::TraceResolver tr; tr.load_stacktrace(_stack); std::stringstream ss;