Manos Chorianopoulos

Possible fix for push crash

...@@ -263,9 +263,21 @@ static const char* jailbreak_apps[] = ...@@ -263,9 +263,21 @@ static const char* jailbreak_apps[] =
263 return; 263 return;
264 } 264 }
265 265
266 - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil]; 266 +
267 - NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 267 + @try {
268 - WLLOG(@"Did receive push: %@", jsonString); 268 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil];
269 + NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
270 + WLLOG(@"Did receive push: %@", jsonString);
271 + }
272 + @catch (NSException *exception) {
273 + // NSLog(@"Print userInfo error: %@", exception.reason);
274 + }
275 + @finally {
276 +// NSLog(@"Finally condition");
277 + }
278 +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil];
279 +// NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
280 +// WLLOG(@"Did receive push: %@", jsonString);
269 WLInboxItem *inboxItem = [[WLInboxItem alloc] initWithAttributes:userInfo] ; 281 WLInboxItem *inboxItem = [[WLInboxItem alloc] initWithAttributes:userInfo] ;
270 // [WLAnalyticsManager logUserReceivedPush:inboxItem]; 282 // [WLAnalyticsManager logUserReceivedPush:inboxItem];
271 283
...@@ -346,9 +358,20 @@ static const char* jailbreak_apps[] = ...@@ -346,9 +358,20 @@ static const char* jailbreak_apps[] =
346 state = WLApplicationStateBackground; 358 state = WLApplicationStateBackground;
347 359
348 360
349 - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil]; 361 + @try {
350 - NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 362 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil];
351 - WLLOG(@"Did receive push: %@", jsonString); 363 + NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
364 + WLLOG(@"Did receive push: %@", jsonString);
365 + }
366 + @catch (NSException *exception) {
367 + // NSLog(@"Print userInfo error: %@", exception.reason);
368 + }
369 + @finally {
370 +// NSLog(@"Finally condition");
371 + }
372 +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil];
373 +// NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
374 +// WLLOG(@"Did receive push: %@", jsonString);
352 WLInboxItem *inboxItem = [[WLInboxItem alloc] initWithAttributes:userInfo] ; 375 WLInboxItem *inboxItem = [[WLInboxItem alloc] initWithAttributes:userInfo] ;
353 // [WLAnalyticsManager logUserReceivedPush:inboxItem]; 376 // [WLAnalyticsManager logUserReceivedPush:inboxItem];
354 377
...@@ -430,9 +453,20 @@ static const char* jailbreak_apps[] = ...@@ -430,9 +453,20 @@ static const char* jailbreak_apps[] =
430 state = WLApplicationStateBackground; 453 state = WLApplicationStateBackground;
431 454
432 455
433 - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil]; 456 + @try {
434 - NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 457 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil];
435 - WLLOG(@"Did receive push: %@", jsonString); 458 + NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
459 + WLLOG(@"Did receive push: %@", jsonString);
460 + }
461 + @catch (NSException *exception) {
462 + // NSLog(@"Print userInfo error: %@", exception.reason);
463 + }
464 + @finally {
465 +// NSLog(@"Finally condition");
466 + }
467 +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo options:NSJSONWritingPrettyPrinted error:nil];
468 +// NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
469 +// WLLOG(@"Did receive push: %@", jsonString);
436 WLInboxItem *inboxItem = [[WLInboxItem alloc] initWithAttributes:userInfo] ; 470 WLInboxItem *inboxItem = [[WLInboxItem alloc] initWithAttributes:userInfo] ;
437 // [WLAnalyticsManager logUserReceivedPush:inboxItem]; 471 // [WLAnalyticsManager logUserReceivedPush:inboxItem];
438 472
......