Merge pull request #2144 from profanity-im/fix/2124
fix: Fix crash when loading MAM for a contact with empty db
This commit is contained in:
@@ -2636,10 +2636,13 @@ iq_mam_request_older(ProfChatWin* win)
|
|||||||
auto_gchar gchar* enddate = NULL;
|
auto_gchar gchar* enddate = NULL;
|
||||||
|
|
||||||
// If first message found
|
// If first message found
|
||||||
if (first_msg->timestamp) {
|
if (first_msg && first_msg->timestamp) {
|
||||||
firstid = first_msg->stanzaid;
|
firstid = first_msg->stanzaid;
|
||||||
enddate = g_date_time_format(first_msg->timestamp, mam_timestamp_format_string);
|
enddate = g_date_time_format(first_msg->timestamp, mam_timestamp_format_string);
|
||||||
} else {
|
} else {
|
||||||
|
if (first_msg) {
|
||||||
|
message_free(first_msg);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user