1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00

error checking

This commit is contained in:
B. Petersen 2017-12-04 21:19:37 +01:00
parent 8c9b8e410d
commit cd3726eab0
2 changed files with 5 additions and 1 deletions

View file

@ -3125,7 +3125,7 @@ uint32_t mrmailbox_send_msg_object(mrmailbox_t* mailbox, uint32_t chat_id, mrmsg
{ {
char* pathNfilename = NULL; char* pathNfilename = NULL;
if( mailbox == NULL || msg == NULL ) { /* we do not check for "chat_id <= MR_CHAT_ID_LAST_SPECIAL" as special chats may be needed eg. for the setup message */ if( mailbox == NULL || msg == NULL || chat_id <= MR_CHAT_ID_LAST_SPECIAL ) {
return 0; return 0;
} }

View file

@ -672,6 +672,10 @@ int mrmsg_is_systemcmd(mrmsg_t* msg)
*/ */
int mrmsg_is_setupmessage(mrmsg_t* msg) int mrmsg_is_setupmessage(mrmsg_t* msg)
{ {
if( msg == NULL ) {
return 0;
}
return mrparam_get_int(msg->m_param, MRP_SYSTEM_CMD, 0)==MR_SYSTEM_AUTOCRYPT_SETUP_MESSAGE? 1 : 0; return mrparam_get_int(msg->m_param, MRP_SYSTEM_CMD, 0)==MR_SYSTEM_AUTOCRYPT_SETUP_MESSAGE? 1 : 0;
} }