Skip to content

Commit b8689d3

Browse files
committed
iOs: NSDictionary protected from nil value
1 parent b3a0d03 commit b8689d3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ios/CDVDevice.m

+7-3
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,16 @@ - (NSDictionary*)deviceProperties
9898
{
9999
UIDevice* device = [UIDevice currentDevice];
100100

101+
NSString* modelVersion = [device modelVersion];
102+
NSString* systemVersion = [device systemVersion];
103+
NSString* uniqueId = [self uniqueAppInstanceIdentifier:device];
104+
101105
return @{
102106
@"manufacturer": @"Apple",
103-
@"model": [device modelVersion],
107+
@"model": modelVersion ? modelVersion : @"",
104108
@"platform": @"iOS",
105-
@"version": [device systemVersion],
106-
@"uuid": [self uniqueAppInstanceIdentifier:device],
109+
@"version": systemVersion ? systemVersion : @"",
110+
@"uuid": uniqueId ? uniqueId : @"",
107111
@"cordova": [[self class] cordovaVersion],
108112
@"isVirtual": @([self isVirtual]),
109113
@"isiOSAppOnMac": @([self isiOSAppOnMac])

0 commit comments

Comments
 (0)