Skip to content

Commit 96daff5

Browse files
David GrigoryanGUserx
David Grigoryan
authored andcommitted
Crash preventation
1 parent 0dd8dda commit 96daff5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Crashlytics/Crashlytics/Controllers/FIRCLSNetworkClient.m

+6-2
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ - (BOOL)supportsBackgroundRequests {
132132

133133
- (void)attemptToReconnectBackgroundSessionWithCompletionBlock:(void (^)(void))completionBlock {
134134
if (!self.supportsBackgroundRequests) {
135-
completionBlock();
135+
if (completionBlock) {
136+
completionBlock();
137+
}
136138
return;
137139
}
138140

139141
// This is the absolute minimum necessary. Perhaps we can do better?
140-
[[NSOperationQueuemainQueue] addOperationWithBlock:completionBlock];
142+
if (completionBlock) {
143+
[[NSOperationQueuemainQueue] addOperationWithBlock:completionBlock];
144+
}
141145
}
142146

143147
#pragma mark - API

0 commit comments

Comments
 (0)
close