Skip to content

Commit

Permalink
Merge pull request #199 from getsentry/bugfix/last-context
Browse files Browse the repository at this point in the history
Fix initialization of last context
  • Loading branch information
HazAT authored Aug 23, 2017
2 parents d017014 + c808ad2 commit b2e0708
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/Sentry/SentryClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,11 @@ - (void)clearContext {
}

- (void)restoreContextBeforeCrash {
self.lastContext = [[NSDictionary alloc] initWithObjectsAndKeys:
[[NSUserDefaults standardUserDefaults] objectForKey:@"sentry.io.tags"], @"tags",
[[NSUserDefaults standardUserDefaults] objectForKey:@"sentry.io.extra"], @"extra",
[[NSUserDefaults standardUserDefaults] objectForKey:@"sentry.io.user"], @"user", nil];
NSMutableDictionary *context = [[NSMutableDictionary alloc] init];
[context setValue:[[NSUserDefaults standardUserDefaults] objectForKey:@"sentry.io.tags"] forKey:@"tags"];
[context setValue:[[NSUserDefaults standardUserDefaults] objectForKey:@"sentry.io.extra"] forKey:@"extra"];
[context setValue:[[NSUserDefaults standardUserDefaults] objectForKey:@"sentry.io.user"] forKey:@"user"];
self.lastContext = context;
}

#pragma mark KSCrash
Expand Down

0 comments on commit b2e0708

Please sign in to comment.