@@ -95,7 +95,7 @@ - (void)filterReports:(NSArray *)reports
9595 }
9696#pragma clang diagnostic pop
9797
98- if (reportData == nil || [reportData count ] <= 0 ) {
98+ if (reportData == nil ) {
9999 if (onCompletion) {
100100 onCompletion (@[], YES , nil );
101101 }
@@ -113,20 +113,17 @@ - (void)filterReports:(NSArray *)reports
113113// Generates the payload for notifying Bugsnag
114114- (NSDictionary *)getBodyFromReports : (NSArray *)reports {
115115 NSMutableDictionary *data = [[NSMutableDictionary alloc ] init ];
116+ BSGDictSetSafeObject (data, [Bugsnag notifier ].details , BSGKeyNotifier);
117+ BSGDictSetSafeObject (data, [Bugsnag notifier ].configuration .apiKey , BSGKeyApiKey);
116118
117- if ([Bugsnag notifier ].configuration .apiKey .length > 0 ) {
118- BSGDictSetSafeObject (data, [Bugsnag notifier ].details , BSGKeyNotifier);
119- BSGDictSetSafeObject (data, [Bugsnag notifier ].configuration .apiKey , BSGKeyApiKey);
119+ NSMutableArray *formatted =
120+ [[NSMutableArray alloc ] initWithCapacity: [reports count ]];
120121
121- NSMutableArray *formatted =
122- [[NSMutableArray alloc ] initWithCapacity: [reports count ]];
123-
124- for (BugsnagCrashReport *report in reports) {
125- BSGArrayAddSafeObject (formatted, [report toJson ]);
126- }
127-
128- BSGDictSetSafeObject (data, formatted, BSGKeyEvents);
122+ for (BugsnagCrashReport *report in reports) {
123+ BSGArrayAddSafeObject (formatted, [report toJson ]);
129124 }
125+
126+ BSGDictSetSafeObject (data, formatted, BSGKeyEvents);
130127 return data;
131128}
132129
0 commit comments