From ff62a107f10fa586e25a46aef4fe06dea18b6c10 Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Wed, 15 Nov 2017 12:44:19 +0100 Subject: Fix crash in parsing pending message count --- src/mwi/simple_msg_sum_body.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mwi/simple_msg_sum_body.cpp b/src/mwi/simple_msg_sum_body.cpp index b42be6a..34aeede 100644 --- a/src/mwi/simple_msg_sum_body.cpp +++ b/src/mwi/simple_msg_sum_body.cpp @@ -54,8 +54,12 @@ bool t_msg_summary::parse(const string &s) { } else if (m.size() == 5) { newmsgs = std::stoul(m.str(1), NULL, 10); oldmsgs = std::stoul(m.str(2), NULL, 10); - newmsgs_urgent = std::stoul(m.str(3), NULL, 10); - oldmsgs_urgent = std::stoul(m.str(4), NULL, 10); + + if (!m.str(3).empty()) + newmsgs_urgent = std::stoul(m.str(3), NULL, 10); + if (!m.str(4).empty()) + oldmsgs_urgent = std::stoul(m.str(4), NULL, 10); + return true; } -- cgit v1.2.3