Skip to content

Commit f1789aa

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ios/CDVDevice.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,14 @@ - (NSDictionary*)deviceProperties
9898
{
9999
UIDevice* device = [UIDevice currentDevice];
100100

101+
NSString* modelVersion = [device modelVersion];
102+
NSString* systemVersion = [device systemVersion];
103+
101104
return @{
102105
@"manufacturer": @"Apple",
103-
@"model": [device modelVersion],
106+
@"model": modelVersion ? modelVersion : @"",
104107
@"platform": @"iOS",
105-
@"version": [device systemVersion],
108+
@"version": systemVersion ? systemVersion : @"",
106109
@"uuid": [self uniqueAppInstanceIdentifier:device],
107110
@"cordova": [[self class] cordovaVersion],
108111
@"isVirtual": @([self isVirtual]),

0 commit comments

Comments
 (0)