fix(ios): for issue #2434 (#2439)

When VCARD doesnt contain ALL name fields, app crashes because it is trying to insert nil values into dictionary. This provides blank strings for nil values in vcard
This commit is contained in:
Zayin Krige 2019-08-22 16:48:56 +02:00 committed by Sibelius Seraphini
parent 8c93ebd7aa
commit c9402b2ddd

View File

@ -149,14 +149,14 @@
if(barcode.contactInfo.name) {
FIRVisionBarcodePersonName *name = barcode.contactInfo.name;
NSObject *nameObject = @{
@"formattedName" : name.formattedName,
@"firstName" : name.first,
@"middleName" : name.middle,
@"lastName" : name.last,
@"prefix" : name.prefix,
@"pronounciation" : name.pronounciation,
@"suffix" : name.suffix,
};
@"formattedName" : name.formattedName ? name.formattedName : @"",
@"firstName" : name.first ? name.first : @"",
@"middleName" : name.middle ? name.middle : @"",
@"lastName" : name.last ? name.last : @"",
@"prefix" : name.prefix ? name.prefix : @"",
@"pronounciation" : name.pronounciation ? name.pronounciation : @"",
@"suffix" : name.suffix ? name.suffix : @"",
};
[resultDict setObject:nameObject forKey:@"name"];
}
if(barcode.contactInfo.phones) {