From 77cfd51d92bcaf49faf4a4fe9713078810b0a2fd Mon Sep 17 00:00:00 2001 From: vvaltman Date: Mon, 1 Jun 2015 15:44:48 +0300 Subject: [PATCH] fixed crash on empty photo --- interface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interface.c b/interface.c index 9d175a7..0df696a 100644 --- a/interface.c +++ b/interface.c @@ -3061,8 +3061,9 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) { case tgl_message_media_none: return; case tgl_message_media_photo: - assert (M->photo); - if (M->photo->caption && strlen (M->photo->caption)) { + if (!M->photo) { + mprintf (ev, "[photo bad]"); + } else if (M->photo->caption && strlen (M->photo->caption)) { mprintf (ev, "[photo %s]", M->photo->caption); } else { mprintf (ev, "[photo]");