Skip to content

Commit

Permalink
Fix unknown RPC crash #1713
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed Jul 15, 2020
1 parent 280d05c commit cae8bfb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SmartDeviceLink/SDLLifecycleProtocolHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<SDLRPCMessage *> *adaptedMessages = [SDLLifecycleRPCAdapter adaptRPC:newMessage direction:SDLRPCDirectionIncoming];
for (SDLRPCMessage *message in adaptedMessages) {
Expand Down

0 comments on commit cae8bfb

Please sign in to comment.