messagingappbase/smartmessaging/vcardbc/src/vcardvpbutil.cpp
branchRCL_3
changeset 54 fa1df4b99609
parent 2 0bf1d54f37d9
--- a/messagingappbase/smartmessaging/vcardbc/src/vcardvpbutil.cpp	Thu Jul 15 18:34:37 2010 +0300
+++ b/messagingappbase/smartmessaging/vcardbc/src/vcardvpbutil.cpp	Thu Aug 19 09:51:11 2010 +0300
@@ -246,15 +246,25 @@
 MVPbkStoreContact* CVCardVpbUtil::ContactData() const
 	{
 	__ASSERT_DEBUG( iContactsToShow.Count() > 0, Panic( ENoContactImported ) );
+	// If iContactsToShow.Count() is zero, then it is not possible to parse the fields,so it has to return from here..
+	if ( iContactsToShow.Count() == 0 )
+		{
+	    return NULL;
+		}
 	return iContactsToShow[0];
 	}
 
 TBool CVCardVpbUtil::IsContactItemEmpty()
 	{
-	const MVPbkStoreContactFieldCollection& fields = ContactData()->Fields();
+	TBool ret( ETrue );
+	MVPbkStoreContact* storeContact = ContactData();
+	if ( !storeContact )
+		{
+	    return ret;
+		}
+	const MVPbkStoreContactFieldCollection& fields = storeContact->Fields();
     TInt count = fields.FieldCount();
 
-    TBool ret( ETrue );
     while( count )
         {
         __ASSERT_DEBUG( count <= fields.FieldCount() && count > 0,