Unverified Commit b6b3b7f4 authored by Mehdi Achour's avatar Mehdi Achour Committed by GitHub

fix: prevent insertion of nil values in the dictionary (#328)

Closes #38 #89 
parent b1a50f6b
......@@ -268,21 +268,21 @@ RCT_EXPORT_MODULE(RNDeviceInfo)
@"systemName": currentDevice.systemName,
@"systemVersion": currentDevice.systemVersion,
@"apiLevel": @"not available",
@"model": self.deviceName,
@"model": self.deviceName ?: [NSNull null],
@"brand": @"Apple",
@"deviceId": self.deviceId,
@"deviceId": self.deviceId ?: [NSNull null],
@"deviceName": currentDevice.name,
@"deviceLocale": self.deviceLocale,
@"deviceLocale": self.deviceLocale ?: [NSNull null],
@"deviceCountry": self.deviceCountry ?: [NSNull null],
@"uniqueId": uniqueId,
@"appName": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"],
@"bundleId": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"],
@"appName": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] ?: [NSNull null],
@"bundleId": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"] ?: [NSNull null],
@"appVersion": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: [NSNull null],
@"buildNumber": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"],
@"buildNumber": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] ?: [NSNull null],
@"systemManufacturer": @"Apple",
@"carrier": self.carrier ?: [NSNull null],
@"userAgent": self.userAgent,
@"timezone": self.timezone,
@"userAgent": self.userAgent ?: [NSNull null],
@"timezone": self.timezone ?: [NSNull null],
@"isEmulator": @(self.isEmulator),
@"isTablet": @(self.isTablet),
@"is24Hour": @(self.is24Hour),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment