From 4c5f9b797ac5d1710bb0b225518eded9f0b458ac Mon Sep 17 00:00:00 2001 From: Vincent Castellano Date: Wed, 10 Jun 2015 00:28:01 -0700 Subject: [PATCH] Add missing null check --- python-tg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-tg.c b/python-tg.c index adf509b..a0e36fc 100644 --- a/python-tg.c +++ b/python-tg.c @@ -808,7 +808,7 @@ void py_do_all (void) { break; case pq_msg: if(PyArg_ParseTuple(args, "O!s#|OO", &tgl_PeerType, &peer, &str, &len, &cb_extra, &pyObj1)) { - if(PyArg_ParseTuple(pyObj1, "ii", &preview, &reply_id)) { + if(pyObj1 && PyArg_ParseTuple(pyObj1, "ii", &preview, &reply_id)) { if(preview != -1) { if(preview) flags |= TGL_SEND_MSG_FLAG_ENABLE_PREVIEW;