X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol.c;fp=src%2Fprotocol.c;h=39f529a268045ef78a1956a1970380dc440c719e;hb=d65d4f25019af86563cc10d00fecce82e861e0a1;hp=5d28883778aa4957a5b849e547aee89a422c76f6;hpb=c5ef941dafcbce05801f65f9cf7abe8aa4a3e641;p=meshlink diff --git a/src/protocol.c b/src/protocol.c index 5d288837..39f529a2 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -67,10 +67,14 @@ bool check_id(const char *id) { detection as well */ bool send_request(meshlink_handle_t *mesh, connection_t *c, const submesh_t *s, const char *format, ...) { - assert(c); assert(format); assert(*format); + if(!c) { + logger(mesh, MESHLINK_ERROR, "Trying to send request to non-existing connection"); + return false; + } + va_list args; char request[MAXBUFSIZE]; int len;