[pan2] Do not use front() on empty vector
- From: Petr Kovář <pmkovar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] Do not use front() on empty vector
- Date: Fri, 6 Apr 2018 15:43:10 +0000 (UTC)
commit 7ec8ca1c45763682f159793b720b982b1618a488
Author: Jonathan Briggs <zlynx acm org>
Date: Fri Apr 6 17:42:29 2018 +0200
Do not use front() on empty vector
pan/data-impl/rules-filter.cc | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/pan/data-impl/rules-filter.cc b/pan/data-impl/rules-filter.cc
index abc2506..c0d26c4 100644
--- a/pan/data-impl/rules-filter.cc
+++ b/pan/data-impl/rules-filter.cc
@@ -36,7 +36,9 @@ RulesFilter :: finalize (Data& data)
_delete.clear();
const std::vector<const Article*> tmp (_mark_read.begin(), _mark_read.end());
- data.mark_read ((const Article**)&tmp.front(), tmp.size());
+ if (!tmp.empty()) {
+ data.mark_read ((const Article**)&tmp.front(), tmp.size());
+ }
_mark_read.clear();
const std::vector<const Article*> tmp2 ( _cached.begin(), _cached.end());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]