diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2021-04-15 15:52:27 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2021-04-15 15:52:27 -0400 |
commit | 8be3bc60a9c804d73a70586ec790ed024e98821b (patch) | |
tree | e22090e2ec0e24b72ecb28dd12a3554b28bb4585 | |
parent | 48d6c3db34353c81c600b081bc844841a056add2 (diff) | |
download | sdl_ios-8be3bc60a9c804d73a70586ec790ed024e98821b.tar.gz |
Fix JSON error
-rw-r--r-- | SmartDeviceLink/private/SDLProtocol.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/SmartDeviceLink/private/SDLProtocol.m b/SmartDeviceLink/private/SDLProtocol.m index 917d857c0..36f2a20b9 100644 --- a/SmartDeviceLink/private/SDLProtocol.m +++ b/SmartDeviceLink/private/SDLProtocol.m @@ -294,9 +294,10 @@ NS_ASSUME_NONNULL_BEGIN NSError *jsonError = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[message serializeAsDictionary:(Byte)[SDLGlobals sharedGlobals].protocolVersion.major] options:kNilOptions error:&jsonError]; - if (error != nil) { + if (jsonError != nil) { *error = jsonError; - SDLLogW(@"Error encoding JSON data: %@", *error); + SDLLogW(@"Error encoding JSON data: %@", jsonError); + return NO; } NSData *messagePayload = nil; |