diff options
author | NicoleYarroch <nicole@livio.io> | 2020-06-15 08:35:43 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2020-06-15 08:35:43 -0400 |
commit | 3bf741ea56466ac4ec769a23549d92f5a161411c (patch) | |
tree | 036d8060cf776126e880aad17571108dcd01334e | |
parent | 35587bac9f73780424da3d180a4acf9b3277befb (diff) | |
download | sdl_ios-3bf741ea56466ac4ec769a23549d92f5a161411c.tar.gz |
Removed check for `nil` delegate
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r-- | SmartDeviceLink/SDLIAPControlSession.m | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/SmartDeviceLink/SDLIAPControlSession.m b/SmartDeviceLink/SDLIAPControlSession.m index 8841b35cb..1ae64643c 100644 --- a/SmartDeviceLink/SDLIAPControlSession.m +++ b/SmartDeviceLink/SDLIAPControlSession.m @@ -49,7 +49,6 @@ int const ProtocolIndexTimeoutSeconds = 10; - (void)startSession { if (self.accessory == nil) { SDLLogW(@"There is no control session in progress, attempting to create a new control session."); - if (self.delegate == nil) { return; } [self.delegate controlSessionShouldRetry]; } else { SDLLogD(@"Starting a control session with accessory (%@)", self.accessory.name); @@ -60,7 +59,6 @@ int const ProtocolIndexTimeoutSeconds = 10; SDLLogW(@"Control session failed to setup with accessory: %@. Attempting to create a new control session", strongSelf.accessory); [strongSelf destroySessionWithCompletionHandler:^{ __strong typeof(weakSelf) strongSelf = weakSelf; - if (strongSelf.delegate == nil) { return; } [strongSelf.delegate controlSessionShouldRetry]; }]; } else { @@ -179,7 +177,6 @@ int const ProtocolIndexTimeoutSeconds = 10; __weak typeof(self) weakSelf = self; [self destroySessionWithCompletionHandler:^{ __strong typeof(weakSelf) strongSelf = weakSelf; - if (strongSelf.delegate == nil) { return; } [strongSelf.delegate controlSessionShouldRetry]; }]; } @@ -208,10 +205,7 @@ int const ProtocolIndexTimeoutSeconds = 10; __strong typeof(weakSelf) strongSelf = weakSelf; if (strongSelf.accessory.isConnected) { [strongSelf.protocolIndexTimer cancel]; - - if (strongSelf.delegate != nil) { - [strongSelf.delegate controlSession:strongSelf didReceiveProtocolString:indexedProtocolString]; - } + [strongSelf.delegate controlSession:strongSelf didReceiveProtocolString:indexedProtocolString]; } }]; } @@ -226,7 +220,6 @@ int const ProtocolIndexTimeoutSeconds = 10; __weak typeof(self) weakSelf = self; [self destroySessionWithCompletionHandler:^{ __strong typeof(weakSelf) strongSelf = weakSelf; - if (strongSelf.delegate == nil) { return; } [strongSelf.delegate controlSessionShouldRetry]; }]; } @@ -247,7 +240,6 @@ int const ProtocolIndexTimeoutSeconds = 10; SDLLogW(@"Control session failed to get the protocol string from Core after %d seconds, retrying.", ProtocolIndexTimeoutSeconds); [strongSelf destroySessionWithCompletionHandler:^{ __strong typeof(weakSelf) strongSelf = weakSelf; - if (strongSelf.delegate == nil) { return; } [strongSelf.delegate controlSessionShouldRetry]; }]; }; |