From 0a0f2f0d69e694dd7dd3489bdfe6a3ad6281c230 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 16 Dec 2014 19:35:36 +0100 Subject: Fix crash when using -M with empty result ledger -f /dev/null reg -M test causes a segmentation fault, see bug 730 and duplicates 1080 and 1084 for details. Kudos to Ikke for helping with debugging. --- src/filters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index bdc2983b..d24188f5 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -983,7 +983,7 @@ void interval_posts::flush() sort_posts_by_date()); // Determine the beginning interval by using the earliest post - if (all_posts.front() && + if (all_posts.size() > 0 && all_posts.front() && ! interval.find_period(all_posts.front()->date())) throw_(std::logic_error, _("Failed to find period for interval report")); -- cgit v1.2.3