From a5f537628b6881c0df6a33876ab502fec5eeecbe Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 4 Feb 2018 11:55:03 +0000 Subject: [PATCH] XCCalendarDay: Stop Xestia Calendar from crashing when deleting a calendar event --- source/widgets/XCCalendarDay.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/widgets/XCCalendarDay.cpp b/source/widgets/XCCalendarDay.cpp index 64bd1b4..9af071c 100644 --- a/source/widgets/XCCalendarDay.cpp +++ b/source/widgets/XCCalendarDay.cpp @@ -524,12 +524,17 @@ void XCCalendarDay::DeleteCalendarEntries(wxCommandEvent &calendarData){ this->Refresh(); mainPanel->Layout(); - eventListFrameSizer->Layout(); - - for (auto deleteIter : deleteEntriesList){ + + for (auto deleteIter : deleteEntriesList) { calendarEntryList.erase(deleteIter); } - + + if (calendarEntryList.size() > 0) + { + eventListFrame->Layout(); + eventListFrameSizer->Layout(); + } + } void XCCalendarDay::DeleteCalendarEntry(wxCommandEvent &eventData){ -- 2.39.5