summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-07-27 10:33:09 -0400
committerGitHub <noreply@github.com>2017-07-27 10:33:09 -0400
commitc93b483a98054558516986b2d3c4f3538d72d95d (patch)
treeff692c2628e4be0ae2f85ca9d8095b567cf5a895
parentfa0fa8d1999ee54009bfff5e407c1bd3d9a27f99 (diff)
downloadsdl_ios-c93b483a98054558516986b2d3c4f3538d72d95d.tar.gz
Clarify a bit of control flow
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m12
1 files changed, 5 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m
index 531fc78c0..8f387e727 100644
--- a/SmartDeviceLink/SDLIAPTransport.m
+++ b/SmartDeviceLink/SDLIAPTransport.m
@@ -141,16 +141,14 @@ int const streamOpenTimeoutSeconds = 2;
// Stop event listening here so that even if the transport is disconnected by the proxy
// we unregister for accessory local notifications
[self sdl_stopEventListening];
- if (self.controlSession) {
+ if (self.controlSession != nil) {
[self.controlSession stop];
self.controlSession.streamDelegate = nil;
self.controlSession = nil;
- } else {
- if (self.session != nil) {
- [self.session stop];
- self.session.streamDelegate = nil;
- self.session = nil;
- }
+ } else if (self.session != nil) {
+ [self.session stop];
+ self.session.streamDelegate = nil;
+ self.session = nil;
}
}