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:
parent
8c93ebd7aa
commit
c9402b2ddd
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user