diff options
author | Don Sanders <don.sanders@nokia.com> | 2011-10-05 16:28:36 +0300 |
---|---|---|
committer | Don Sanders <don.sanders@nokia.com> | 2011-10-05 16:28:36 +0300 |
commit | de99fa990fec34430b9082f1c9f8b1fa9fd3e373 (patch) | |
tree | 6c60011c10dc232f19d2d5f95584e6d2c81c4d87 | |
parent | e768b452f83a08c19571e86cab18d7afb7a472bf (diff) |
Fix regression introduced when merging fix for NB#2721172011W40_2
Don't crash when attempting to send using invalid smtp settings.
-rw-r--r-- | src/plugins/messageservices/smtp/smtpclient.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/messageservices/smtp/smtpclient.cpp b/src/plugins/messageservices/smtp/smtpclient.cpp index e890dad6..01378829 100644 --- a/src/plugins/messageservices/smtp/smtpclient.cpp +++ b/src/plugins/messageservices/smtp/smtpclient.cpp @@ -847,9 +847,13 @@ void SmtpClient::operationFailed(int code, const QString &text) void SmtpClient::operationFailed(QMailServiceAction::Status::ErrorCode code, const QString &text) { - QMailServiceAction::Status status; - status.messageId = mailItr->mail.id(); - status.errorCode = code; + QMailServiceAction::Status actionStatus; + if ((status != Init) && (status != Quit) && (status != Done) && (mailItr != mailList.end())) { + actionStatus.messageId = mailItr->mail.id(); + } else { + actionStatus.messageId = QMailMessageId(); + } + actionStatus.errorCode = code; if (code != QMailServiceAction::Status::ErrNoError) { delete authTimeout; @@ -877,7 +881,7 @@ void SmtpClient::operationFailed(QMailServiceAction::Status::ErrorCode code, con msg.append(bufferedResponse); msg.append(text); - emit errorOccurred(status, msg); + emit errorOccurred(actionStatus, msg); } void SmtpClient::sendMoreData(qint64 bytesWritten) |