--- a/serviceproviders/sapi_contacts_vpbk/contactservice/src/singlecontact.cpp Thu Sep 10 12:58:20 2009 +0300
+++ b/serviceproviders/sapi_contacts_vpbk/contactservice/src/singlecontact.cpp Thu Sep 24 12:43:20 2009 +0300
@@ -187,7 +187,14 @@
MVPbkStoreContactField& field = aSingleContact->Fields().FieldAt(aIndex);
//Get the fieldKey of the field
- TPtrC8 fieldKey = CSearchFields::GetFieldKeyFromId(field.BestMatchingFieldType()->FieldTypeResId());
+ const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
+ if(fieldType == NULL)
+ {
+ CleanupStack::PopAndDestroy(contactField);
+ return NULL;
+ }
+ TInt idval = fieldType->FieldTypeResId();
+ TPtrC8 fieldKey = CSearchFields::GetFieldKeyFromId(idval);
if(fieldKey.Compare(KNullDesC8) == 0)
{
CleanupStack::PopAndDestroy(contactField);