File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Crashlytics/Crashlytics/Controllers Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -146,17 +146,21 @@ - (BOOL)processMetricKitPayload:(MXDiagnosticPayload *)diagnosticPayload
146
146
// Also ensure that there is a report from the last run of the app that we can write to.
147
147
NSString *metricKitFatalReportFile;
148
148
NSString *metricKitNonfatalReportFile;
149
+
149
150
NSString *newestUnsentReportID =
150
- [self .existingReportManager.newestUnsentReport.reportID stringByAppendingString: @" /" ];
151
+ self.existingReportManager .newestUnsentReport .reportID
152
+ ? [self .existingReportManager.newestUnsentReport.reportID stringByAppendingString: @" /" ]
153
+ : nil ;
151
154
NSString *currentReportID =
152
155
[_managerData.executionIDModel.executionID stringByAppendingString: @" /" ];
153
- BOOL fatal = ([diagnosticPayload.crashDiagnostics count ] > 0 ) && (newestUnsentReportID != nil ) &&
154
- ([self .fileManager
155
- fileExistsAtPath: [activePath stringByAppendingString: newestUnsentReportID]]);
156
+ BOOL crashlyticsFatalReported =
157
+ ([diagnosticPayload.crashDiagnostics count ] > 0 ) && (newestUnsentReportID != nil ) &&
158
+ ([self .fileManager
159
+ fileExistsAtPath: [activePath stringByAppendingString: newestUnsentReportID]]);
156
160
157
161
// Set the MetricKit fatal path appropriately depending on whether we also captured a Crashlytics
158
162
// fatal event and whether the diagnostic report came from a fatal or nonfatal event.
159
- if (fatal ) {
163
+ if (crashlyticsFatalReported ) {
160
164
metricKitFatalReportFile = [[activePath stringByAppendingString: newestUnsentReportID]
161
165
stringByAppendingString: FIRCLSMetricKitFatalReportFile];
162
166
} else {
You can’t perform that action at this time.
0 commit comments