mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-06 00:00:03 +08:00
Call handleLog only if delegate responds to selector
This commit is contained in:
@@ -79,8 +79,10 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
|||||||
- (void)handleLog:(const ClientAPI::LogInfo *)log {
|
- (void)handleLog:(const ClientAPI::LogInfo *)log {
|
||||||
NSAssert(self.delegate != nil, @"delegate property should not be nil");
|
NSAssert(self.delegate != nil, @"delegate property should not be nil");
|
||||||
|
|
||||||
NSString *message = [NSString stringWithCString:log->text.c_str() encoding:NSUTF8StringEncoding];
|
if ([self.delegate respondsToSelector:@selector(handleLog:)]) {
|
||||||
[self.delegate handleLog:message];
|
NSString *message = [NSString stringWithCString:log->text.c_str() encoding:NSUTF8StringEncoding];
|
||||||
|
[self.delegate handleLog:message];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OpenVPNEvent)getEventIdentifierByName:(NSString *)eventName {
|
- (OpenVPNEvent)getEventIdentifierByName:(NSString *)eventName {
|
||||||
|
|||||||
Reference in New Issue
Block a user