summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2014-12-16 19:35:36 +0100
committerAlexis Hildebrandt <afh@surryhill.net>2014-12-16 19:37:37 +0100
commit0a0f2f0d69e694dd7dd3489bdfe6a3ad6281c230 (patch)
tree59e926d974cabe8485273ed3cfa9691e6fc9c64c /src/filters.cc
parent5717a03e3b23a98873e83b3f00b855cfb8201d3a (diff)
downloadfork-ledger-0a0f2f0d69e694dd7dd3489bdfe6a3ad6281c230.tar.gz
fork-ledger-0a0f2f0d69e694dd7dd3489bdfe6a3ad6281c230.tar.bz2
fork-ledger-0a0f2f0d69e694dd7dd3489bdfe6a3ad6281c230.zip
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.
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc2
1 files changed, 1 insertions, 1 deletions
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"));