diff --git a/cocoa/BugsnagReactNative.m b/cocoa/BugsnagReactNative.m index 3c4abe1d..99aa4b64 100644 --- a/cocoa/BugsnagReactNative.m +++ b/cocoa/BugsnagReactNative.m @@ -137,6 +137,11 @@ + (NSNumberFormatter *)numberFormatter { if (!targetMetadata) targetMetadata = [NSMutableDictionary new]; for (NSString *sectionKey in metadata) { + if (![metadata[sectionKey] isKindOfClass:[NSDictionary class]]) { + NSLog(@"Bugsnag: The metadata recorded for key '%@' is not formatted as key/value pairs. Discarding.", sectionKey); + continue; + } + NSMutableDictionary *section = [targetMetadata[sectionKey] mutableCopy]; if (!section) section = [NSMutableDictionary new];