mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-02-11 00:00:08 +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 {
|
||||
NSAssert(self.delegate != nil, @"delegate property should not be nil");
|
||||
|
||||
NSString *message = [NSString stringWithCString:log->text.c_str() encoding:NSUTF8StringEncoding];
|
||||
[self.delegate handleLog:message];
|
||||
if ([self.delegate respondsToSelector:@selector(handleLog:)]) {
|
||||
NSString *message = [NSString stringWithCString:log->text.c_str() encoding:NSUTF8StringEncoding];
|
||||
[self.delegate handleLog:message];
|
||||
}
|
||||
}
|
||||
|
||||
- (OpenVPNEvent)getEventIdentifierByName:(NSString *)eventName {
|
||||
|
||||
Reference in New Issue
Block a user