From 068ea7902436478c352e83222fe2f8725c7cee92 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 29 Sep 2020 13:31:16 +0300 Subject: Import: fix for rare crash in mcontacts import --- plugins/Import/src/mcontacts.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/Import/src/mcontacts.cpp b/plugins/Import/src/mcontacts.cpp index c9d843aa34..2def8eefce 100644 --- a/plugins/Import/src/mcontacts.cpp +++ b/plugins/Import/src/mcontacts.cpp @@ -241,6 +241,9 @@ public: STDMETHODIMP_(MEVENT) FindFirstEvent(MCONTACT) override { + if (m_events.empty()) + return 0; + m_curr = m_events.begin(); return *m_curr; } @@ -256,6 +259,9 @@ public: STDMETHODIMP_(MEVENT) FindLastEvent(MCONTACT) override { + if (m_events.empty()) + return 0; + m_curr = m_events.end(); return *m_curr; } -- cgit v1.2.3