diff --git a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp --- a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp +++ b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp @@ -187,6 +187,10 @@ return Ok; } + if (!asyncResultObserver) { + return Ok; + } + /** Formating is async now because we need to fetch incidences from akonadi. Basically this method (format()) will be called twice. The first time it creates the memento that fetches incidences and returns. @@ -230,11 +234,8 @@ } else { MemoryCalendarMemento *memento = new MemoryCalendarMemento(); bodyPart->setBodyPartMemento(memento); - - if (asyncResultObserver) { - QObject::connect(memento, SIGNAL(update(MessageViewer::UpdateMode)), - asyncResultObserver, SLOT(update(MessageViewer::UpdateMode))); - } + QObject::connect(memento, SIGNAL(update(MessageViewer::UpdateMode)), + asyncResultObserver, SLOT(update(MessageViewer::UpdateMode))); } return Ok;