diff options
-rw-r--r-- | SmartDeviceLink/SDLLifecycleProtocolHandler.m | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLLifecycleProtocolHandler.m b/SmartDeviceLink/SDLLifecycleProtocolHandler.m index 648c259ec..d517e89ee 100644 --- a/SmartDeviceLink/SDLLifecycleProtocolHandler.m +++ b/SmartDeviceLink/SDLLifecycleProtocolHandler.m @@ -142,6 +142,9 @@ NS_ASSUME_NONNULL_BEGIN NSString *functionClassName = [NSString stringWithFormat:@"SDL%@", fullName]; SDLRPCMessage *newMessage = [[NSClassFromString(functionClassName) alloc] initWithDictionary:rpcMessageAsDictionary]; + // If we were unable to create the message, it's an unknown type; discard it + if (newMessage == nil) { return; } + // Adapt the incoming message then call the callback NSArray<SDLRPCMessage *> *adaptedMessages = [SDLLifecycleRPCAdapter adaptRPC:newMessage direction:SDLRPCDirectionIncoming]; for (SDLRPCMessage *message in adaptedMessages) { |