From 4d169d866f9aa149d67c8550876f48f413cd14cb Mon Sep 17 00:00:00 2001 From: sehe Date: Mon, 7 Nov 2016 02:39:28 +0100 Subject: [PATCH] avoid invalid iterator dereference --- include/nonius/reporters/html_reporter.h++ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nonius/reporters/html_reporter.h++ b/include/nonius/reporters/html_reporter.h++ index 8e1aa21..877a24b 100644 --- a/include/nonius/reporters/html_reporter.h++ +++ b/include/nonius/reporters/html_reporter.h++ @@ -150,7 +150,7 @@ namespace nonius { mins.push_back(*std::min_element(d.second.samples.begin(), d.second.samples.end())); } } - auto min = *std::min_element(mins.begin(), mins.end()); + auto min = mins.empty()? fp_seconds{} : *std::min_element(mins.begin(), mins.end()); return detail::get_magnitude(min); }