Fixed possible crash when COPYUID/APPENDUID is not supported by the server.

This commit is contained in:
Vincent Richard 2014-01-19 16:45:28 +01:00
parent 2e4bdab704
commit 74e8e47926

View File

@ -1124,7 +1124,7 @@ messageSet IMAPFolder::addMessage
const IMAPParser::resp_text_code* respTextCode =
finalResp->response_done()->response_tagged()->resp_cond_state()->resp_text()->resp_text_code();
if (respTextCode->type() == IMAPParser::resp_text_code::APPENDUID)
if (respTextCode && respTextCode->type() == IMAPParser::resp_text_code::APPENDUID)
return IMAPUtils::buildMessageSet(respTextCode->uid_set());
return messageSet::empty();
@ -1266,7 +1266,7 @@ messageSet IMAPFolder::copyMessages(const folder::path& dest, const messageSet&
const IMAPParser::resp_text_code* respTextCode =
resp->response_done()->response_tagged()->resp_cond_state()->resp_text()->resp_text_code();
if (respTextCode->type() == IMAPParser::resp_text_code::COPYUID)
if (respTextCode && respTextCode->type() == IMAPParser::resp_text_code::COPYUID)
return IMAPUtils::buildMessageSet(respTextCode->uid_set2());
return messageSet::empty();