diff --git a/3rdparty/iaxclient/lib/libiax2/src/iax.c b/3rdparty/iaxclient/lib/libiax2/src/iax.c
index e3d5a1991..37b0171cc 100644
--- a/3rdparty/iaxclient/lib/libiax2/src/iax.c
+++ b/3rdparty/iaxclient/lib/libiax2/src/iax.c
@@ -868,7 +868,12 @@ static int iax_xmit_frame(struct iax_frame *f)
 										f->datalen - sizeof(struct ast_iax2_full_hdr));
 	}
 #endif
-	/* Send the frame raw */
+    if (!f->session) {
+        IAXERROR "No session in iax_xmit_frame");
+        return -1;
+    }
+
+    /* Send the frame raw */
 	res = f->session->sendto(netfd, (const char *) f->data, f->datalen,
 			IAX_SOCKOPTS, f->transfer ?
 			(struct sockaddr *)&(f->session->transfer) :