summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2016-09-30 11:04:18 -0400
committerJoel Fischer <joeljfischer@gmail.com>2016-09-30 11:04:18 -0400
commit059b21101811226a33674f7586b59afc9ae12153 (patch)
treefde4ea612397ffe467416a26dfbae151a3d4c71d
parent9950b319e58d10fda49f3691c4c607bbe08d8c16 (diff)
downloadsdl_ios-059b21101811226a33674f7586b59afc9ae12153.tar.gz
Fix a warning and analyzer error
* Warning is a compiler bug that was worked around * Analyzer error pointed to a case where malformed dictionaries could cause a crash in SDLRPCMessage
-rw-r--r--SmartDeviceLink/SDLProxy.m4
-rw-r--r--SmartDeviceLink/SDLRPCMessage.m4
2 files changed, 7 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m
index 189fd2189..9929853a0 100644
--- a/SmartDeviceLink/SDLProxy.m
+++ b/SmartDeviceLink/SDLProxy.m
@@ -187,7 +187,9 @@ const int POLICIES_CORRELATION_ID = 65535;
}
_streamingMediaManager = [[SDLStreamingMediaManager alloc] initWithProtocol:self.protocol displayCapabilities:self.displayCapabilities];
[self.protocol.protocolDelegateTable addObject:_streamingMediaManager];
- [self.mutableProxyListeners addObject:_streamingMediaManager.touchManager];
+
+ // HAX: The cast is a result of a compiler bug throwing a warning when it shouldn't
+ [self.mutableProxyListeners addObject:(id<SDLProxyListener>)_streamingMediaManager.touchManager];
}
return _streamingMediaManager;
diff --git a/SmartDeviceLink/SDLRPCMessage.m b/SmartDeviceLink/SDLRPCMessage.m
index c5a461600..4d14dd739 100644
--- a/SmartDeviceLink/SDLRPCMessage.m
+++ b/SmartDeviceLink/SDLRPCMessage.m
@@ -31,6 +31,10 @@
}
}
+ if (messageType == nil) {
+ return nil;
+ }
+
function = [store objectForKey:messageType];
parameters = [function objectForKey:SDLNameParameters];
self.bulkData = [dict objectForKey:SDLNameBulkData];