From 3d05f399c5f5e9f5f8fe87706da1a1e6dd7b95d0 Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 8 Oct 2014 14:12:26 +0100 Subject: Check if the call id is valid before cancelling it --- ratox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 3f82528..eb07519 100644 --- a/ratox.c +++ b/ratox.c @@ -1389,7 +1389,7 @@ frienddestroy(struct friend *f) canceltxtransfer(f); cancelrxtransfer(f); - if (toxav_get_call_state(toxav, f->av.num) != av_CallNonExistant) + if (f->av.num != -1 && toxav_get_call_state(toxav, f->av.num) != av_CallNonExistant) cancelcall(f, "Destroying"); for (i = 0; i < LEN(ffiles); i++) { if (f->dirfd != -1) { -- cgit v1.2.3