File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Crashlytics/Crashlytics/Controllers Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,15 @@ - (void)updateRolloutsStateToPersistenceWithRollouts:(NSData *_Nonnull)rollouts
58
58
NSFileHandle *rolloutsFile = [NSFileHandle fileHandleForUpdatingAtPath: rolloutsPath];
59
59
60
60
dispatch_sync (FIRCLSGetLoggingQueue (), ^{
61
- [rolloutsFile seekToEndOfFile ];
62
- [rolloutsFile writeData: rollouts];
63
- NSData *newLineData = [@" \n " dataUsingEncoding: NSUTF8StringEncoding];
64
- [rolloutsFile writeData: newLineData];
61
+ @try {
62
+ [rolloutsFile seekToEndOfFile ];
63
+ NSMutableData *rolloutsWithNewLineData = [rollouts mutableCopy ];
64
+ [rolloutsWithNewLineData appendData: [@" \n " dataUsingEncoding: NSUTF8StringEncoding]];
65
+ [rolloutsFile writeData: rolloutsWithNewLineData];
66
+ } @catch (NSException *exception) {
67
+ FIRCLSDebugLog (@" Failed to write new rollouts. Exception name: %s - message: %s " ,
68
+ exception.name , exception.reason );
69
+ }
65
70
});
66
71
}
67
72
You can’t perform that action at this time.
0 commit comments