summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-04-18 08:09:44 +0200
committerMontel Laurent <[email protected]>2017-04-18 08:09:44 +0200
commit0a409bf4c9d181f0cea7eaa964071303e866a7fb (patch)
tree38df780ad4330eb919ee9e341fcc8e7b9ab37b08
parent72741bc4e65a6c85b3c5f802c940b8ccb2ee7719 (diff)
Make sure that pointer is not null
-rw-r--r--src/abstract/abstractimporter.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/abstract/abstractimporter.cpp b/src/abstract/abstractimporter.cpp
index e429ff6..83ec6a1 100644
--- a/src/abstract/abstractimporter.cpp
+++ b/src/abstract/abstractimporter.cpp
@@ -70,14 +70,16 @@ bool AbstractImporter::importCalendar()
void AbstractImporter::initializeFilter(MailImporter::Filter &filter)
{
- MailImporter::FilterInfo *info = new MailImporter::FilterInfo();
- ImportFilterInfoGui *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage());
- info->setFilterInfoGui(infoGui);
- info->clear(); // Clear info from last time
- MailImporter::FilterImporterAkonadi *filterImporter = new MailImporter::FilterImporterAkonadi(info);
- filterImporter->setRootCollection(mImportWizard->importMailPage()->selectedCollection());
- filter.setFilterImporter(filterImporter);
- filter.setFilterInfo(info);
+ if (mImportWizard) {
+ MailImporter::FilterInfo *info = new MailImporter::FilterInfo();
+ ImportFilterInfoGui *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage());
+ info->setFilterInfoGui(infoGui);
+ info->clear(); // Clear info from last time
+ MailImporter::FilterImporterAkonadi *filterImporter = new MailImporter::FilterImporterAkonadi(info);
+ filterImporter->setRootCollection(mImportWizard->importMailPage()->selectedCollection());
+ filter.setFilterImporter(filterImporter);
+ filter.setFilterInfo(info);
+ }
}
bool AbstractImporter::addFilters(const QString &filterPath, MailCommon::FilterImporterExporter::FilterType type)