avoid send image with empty text to avoid crash

This commit is contained in:
Danmei Chen 2021-02-17 09:31:06 +01:00
parent c67a3fbd99
commit 5cfa7933a8

View file

@ -277,7 +277,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m
linphone_content_set_size(content, _data.length);
_message = linphone_chat_room_create_file_transfer_message(chatRoom, content);
BOOL isOneToOneChat = linphone_chat_room_get_capabilities(chatRoom) & LinphoneChatRoomCapabilitiesOneToOne;
if (!isOneToOneChat && ![_text isEqualToString:@""])
if (!isOneToOneChat && (_text!=nil && ![_text isEqualToString:@""]))
linphone_chat_message_add_text_content(_message, [_text UTF8String]);
linphone_content_unref(content);