diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2016-06-24 10:33:31 -0700 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2016-06-24 10:33:31 -0700 |
commit | ef7d601f2c7139d8809f1993d8c74118f0b00484 (patch) | |
tree | 6b897160d8df77fd43046238eb4a497b6b5c4402 | |
parent | 8199fcfa84e03568333b6c0bfb88c78d45916a94 (diff) | |
download | sdl_ios-ef7d601f2c7139d8809f1993d8c74118f0b00484.tar.gz |
Adding check in the event we receive an invalid timestamp object from Core, we will use device's timestamp.
-rw-r--r-- | SmartDeviceLink/SDLTouchManager.m | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLTouchManager.m b/SmartDeviceLink/SDLTouchManager.m index b6628469f..58e497ef8 100644 --- a/SmartDeviceLink/SDLTouchManager.m +++ b/SmartDeviceLink/SDLTouchManager.m @@ -71,7 +71,13 @@ static NSUInteger const kMaximumNumberOfTouches = 2; SDLTouchCoord* coord = touchEvent.coord.firstObject; NSNumber* timeStampNumber = touchEvent.timeStamp.firstObject; - NSUInteger timeStamp = timeStampNumber.unsignedIntegerValue; + NSUInteger timeStamp; + // In the event we receive a null timestamp, we will supply a device timestamp. + if (timeStampNumber != [NSNull null]) { + timeStamp = timeStampNumber.unsignedIntegerValue; + } else { + timeStamp = [[NSDate date] timeIntervalSince1970] * 1000.0; + } SDLTouch touch = SDLTouchMake(touchEventID, coord.x.floatValue, |