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 @@ - (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg { 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 *adaptedMessages = [SDLLifecycleRPCAdapter adaptRPC:newMessage direction:SDLRPCDirectionIncoming]; for (SDLRPCMessage *message in adaptedMessages) {