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
146146 // Also ensure that there is a report from the last run of the app that we can write to.
147147 NSString *metricKitFatalReportFile;
148148 NSString *metricKitNonfatalReportFile;
149+
149150 NSString *newestUnsentReportID =
150- [self .existingReportManager.newestUnsentReport.reportID stringByAppendingString: @" /" ];
151+ self.existingReportManager .newestUnsentReport .reportID
152+ ? [self .existingReportManager.newestUnsentReport.reportID stringByAppendingString: @" /" ]
153+ : nil ;
151154 NSString *currentReportID =
152155 [_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]]);
156160
157161 // Set the MetricKit fatal path appropriately depending on whether we also captured a Crashlytics
158162 // fatal event and whether the diagnostic report came from a fatal or nonfatal event.
159- if (fatal ) {
163+ if (crashlyticsFatalReported ) {
160164 metricKitFatalReportFile = [[activePath stringByAppendingString: newestUnsentReportID]
161165 stringByAppendingString: FIRCLSMetricKitFatalReportFile];
162166 } else {
You can’t perform that action at this time.
0 commit comments