Merge pull request #632 from StAlphonsos/attila-bugfix-part-index

Fix core dump in mu-server (at least) for cmd:extract index:0 ...
This commit is contained in:
Dirk-Jan C. Binnema 2015-07-01 08:32:05 +03:00
commit 3804c0d0c0
1 changed files with 5 additions and 0 deletions

View File

@ -780,6 +780,11 @@ mu_msg_part_save (MuMsg *msg, MuMsgOptions opts,
part = (GMimeObject*)g_mime_message_part_get_message
(GMIME_MESSAGE_PART (part));
if (!part) {
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
"part %u does not exist", partidx);
return FALSE;
}
if (!GMIME_IS_PART(part) && !GMIME_IS_MESSAGE(part)) {
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
"unexpected type %s for part %u",