Skip to content

Commit b1a5ef9

Browse files
committed
fix: Support stopping/resuming sessions
1 parent e331afe commit b1a5ef9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Source/BugsnagSessionTracker.m

+9-5
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,15 @@ - (void)registerExistingSession:(NSString *)sessionId
116116
user:(BugsnagUser *)user
117117
handledCount:(NSUInteger)handledCount
118118
unhandledCount:(NSUInteger)unhandledCount {
119-
self.currentSession = [[BugsnagSession alloc] initWithId:sessionId
120-
startDate:startedAt
121-
user:user
122-
handledCount:handledCount
123-
unhandledCount:unhandledCount];
119+
if (sessionId != nil) {
120+
self.currentSession = nil;
121+
} else {
122+
self.currentSession = [[BugsnagSession alloc] initWithId:sessionId
123+
startDate:startedAt
124+
user:user
125+
handledCount:handledCount
126+
unhandledCount:unhandledCount];
127+
}
124128
if (self.callback) {
125129
self.callback(self.currentSession);
126130
}

0 commit comments

Comments
 (0)