Commit 9ac02bdc authored by Sebastián Katzer's avatar Sebastián Katzer
Browse files

Fixes #731 Prevent crash when user info is nil

parent 38f58ac2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@
{
    UILocalNotification* notification = [localNotification object];

    if ([notification wasUpdated])
    if ([notification userInfo] == NULL || [notification wasUpdated] )
        return;

    NSTimeInterval timeInterval = [notification timeIntervalSinceLastTrigger];
+4 −1
Original line number Diff line number Diff line
@@ -168,9 +168,12 @@ NSInteger const APPLocalNotificationTypeTriggered = 2;

    [obj removeObjectForKey:@"updatedAt"];

    if (obj == NULL || obj.count == 0)
        return json;

    data = [NSJSONSerialization dataWithJSONObject:obj
                                           options:NSJSONWritingPrettyPrinted
                                             error:Nil];
                                             error:NULL];

    json = [[NSString alloc] initWithData:data
                                 encoding:NSUTF8StringEncoding];