File pan-do-not-use-front-on-empty-vector.patch of Package pan

From 7ec8ca1c45763682f159793b720b982b1618a488 Mon Sep 17 00:00:00 2001
From: Jonathan Briggs <zlynx@acm.org>
Date: Fri, 6 Apr 2018 17:42:29 +0200
Subject: Do not use front() on empty vector

---
 pan/data-impl/rules-filter.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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());
-- 
cgit v0.12

openSUSE Build Service is sponsored by