Commit 1e7aa4b3 authored by Laurent Montel's avatar Laurent Montel 😁

Fix potential crash

parent 75a8e2b5
...@@ -245,7 +245,7 @@ bool Util::saveContents(QWidget *parent, const KMime::Content::List &contents, Q ...@@ -245,7 +245,7 @@ bool Util::saveContents(QWidget *parent, const KMime::Content::List &contents, Q
fileExists = job->exec(); fileExists = job->exec();
} }
if (fileExists) { if (fileExists) {
PimCommon::RenameFileDialog *dlg = new PimCommon::RenameFileDialog(curUrl, QPointer<PimCommon::RenameFileDialog> dlg = new PimCommon::RenameFileDialog(curUrl,
multiple, multiple,
parent); parent);
result result
...@@ -255,7 +255,9 @@ bool Util::saveContents(QWidget *parent, const KMime::Content::List &contents, Q ...@@ -255,7 +255,9 @@ bool Util::saveContents(QWidget *parent, const KMime::Content::List &contents, Q
delete dlg; delete dlg;
continue; continue;
} else if (result == PimCommon::RenameFileDialog::RENAMEFILE_RENAME) { } else if (result == PimCommon::RenameFileDialog::RENAMEFILE_RENAME) {
curUrl = dlg->newName(); if (dlg) {
curUrl = dlg->newName();
}
} }
delete dlg; delete dlg;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment