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) ...@@ -268,21 +268,21 @@ RCT_EXPORT_MODULE(RNDeviceInfo)
@"systemName": currentDevice.systemName, @"systemName": currentDevice.systemName,
@"systemVersion": currentDevice.systemVersion, @"systemVersion": currentDevice.systemVersion,
@"apiLevel": @"not available", @"apiLevel": @"not available",
@"model": self.deviceName, @"model": self.deviceName ?: [NSNull null],
@"brand": @"Apple", @"brand": @"Apple",
@"deviceId": self.deviceId, @"deviceId": self.deviceId ?: [NSNull null],
@"deviceName": currentDevice.name, @"deviceName": currentDevice.name,
@"deviceLocale": self.deviceLocale, @"deviceLocale": self.deviceLocale ?: [NSNull null],
@"deviceCountry": self.deviceCountry ?: [NSNull null], @"deviceCountry": self.deviceCountry ?: [NSNull null],
@"uniqueId": uniqueId, @"uniqueId": uniqueId,
@"appName": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"], @"appName": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] ?: [NSNull null],
@"bundleId": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"], @"bundleId": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"] ?: [NSNull null],
@"appVersion": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: [NSNull null], @"appVersion": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: [NSNull null],
@"buildNumber": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"], @"buildNumber": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] ?: [NSNull null],
@"systemManufacturer": @"Apple", @"systemManufacturer": @"Apple",
@"carrier": self.carrier ?: [NSNull null], @"carrier": self.carrier ?: [NSNull null],
@"userAgent": self.userAgent, @"userAgent": self.userAgent ?: [NSNull null],
@"timezone": self.timezone, @"timezone": self.timezone ?: [NSNull null],
@"isEmulator": @(self.isEmulator), @"isEmulator": @(self.isEmulator),
@"isTablet": @(self.isTablet), @"isTablet": @(self.isTablet),
@"is24Hour": @(self.is24Hour), @"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