Commit 77cfd51d authored by vvaltman's avatar vvaltman

fixed crash on empty photo

parent d81da1fe
...@@ -3061,8 +3061,9 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) { ...@@ -3061,8 +3061,9 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) {
case tgl_message_media_none: case tgl_message_media_none:
return; return;
case tgl_message_media_photo: case tgl_message_media_photo:
assert (M->photo); if (!M->photo) {
if (M->photo->caption && strlen (M->photo->caption)) { mprintf (ev, "[photo bad]");
} else if (M->photo->caption && strlen (M->photo->caption)) {
mprintf (ev, "[photo %s]", M->photo->caption); mprintf (ev, "[photo %s]", M->photo->caption);
} else { } else {
mprintf (ev, "[photo]"); mprintf (ev, "[photo]");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment