From d916ec4b962a1e10416ab1aeb64757b52156f001 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Wed, 10 Jun 2020 08:58:50 +0300 Subject: [PATCH] Add assertion to check if delegate is nil --- Sources/OpenVPNAdapter/library/OpenVPNAdapter.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/OpenVPNAdapter/library/OpenVPNAdapter.mm b/Sources/OpenVPNAdapter/library/OpenVPNAdapter.mm index 62780e8..44bc498 100644 --- a/Sources/OpenVPNAdapter/library/OpenVPNAdapter.mm +++ b/Sources/OpenVPNAdapter/library/OpenVPNAdapter.mm @@ -87,6 +87,8 @@ } - (void)connectUsingPacketFlow:(id)packetFlow { + NSAssert(self.delegate != nil, @"delegate property shouldn't be nil, set it before trying to establish connection."); + self.packetFlowBridge.packetFlow = packetFlow; dispatch_queue_attr_t attributes = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_UTILITY, 0);