From 7bcfe622746f189b2025c54a4dd8e12de903e425 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 27 Nov 2017 12:00:10 +0100 Subject: [PATCH] manage null case --- src/c-wrapper/api/c-chat-room.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index 97b982352..dd3d35c40 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -219,6 +219,9 @@ bctbx_list_t *linphone_chat_room_get_history_range_events (LinphoneChatRoom *cr, LinphoneChatMessage *linphone_chat_room_get_last_message_in_history(LinphoneChatRoom *cr) { shared_ptr cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getLastMessageInHistory(); + if (!cppPtr) + return nullptr; + LinphoneChatMessage *object = L_INIT(ChatMessage); L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr); return object;