From 7cd3479d07d2ca273f14603e682821024c555a9a Mon Sep 17 00:00:00 2001 From: blaize9 Date: Tue, 24 May 2016 02:09:49 -0500 Subject: [PATCH] Fixed error when loading an image of a expired forwarded message(image) originated from a bot (Empty Message) --- queries.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/queries.c b/queries.c index 5c1c5281..790cb915 100644 --- a/queries.c +++ b/queries.c @@ -3301,6 +3301,13 @@ void tgl_do_load_file_location (struct tgl_state *TLS, struct tgl_file_location } void tgl_do_load_photo (struct tgl_state *TLS, struct tgl_photo *photo, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) { + if (!photo) { + tgl_set_query_error (TLS, EINVAL, "Bad photo (invalid)"); + if (callback) { + callback (TLS, callback_extra, 0, 0); + } + return; + } if (!photo->sizes_num) { tgl_set_query_error (TLS, EINVAL, "Bad photo (no photo sizes"); if (callback) {