From 357cf76409d30341a2c4eedcf2568f0abd56e88d Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 6 Jun 2020 15:13:39 +0200 Subject: More runtime error checking --- plugins/statistics/statistics.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/statistics') diff --git a/plugins/statistics/statistics.cpp b/plugins/statistics/statistics.cpp index 3ebd301..b1778f7 100644 --- a/plugins/statistics/statistics.cpp +++ b/plugins/statistics/statistics.cpp @@ -44,7 +44,11 @@ namespace { return 0; } - result += stoull(elements[column]); + try { + result += stoull(elements[column]); + } catch(...) { + std::cerr << "Error: Stats value " << elements[column] << " malformed." << std::endl; + } } return result; -- cgit v1.2.3