phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchermenuhandler.cpp
branchRCL_3
changeset 18 d4f567ce2e7c
parent 15 34879f5cfc63
--- a/phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchermenuhandler.cpp	Thu Jul 15 18:22:55 2010 +0300
+++ b/phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchermenuhandler.cpp	Thu Aug 19 09:41:07 2010 +0300
@@ -544,23 +544,27 @@
         TPtrC8 contactLink = param->Value().AsData();
 
         // Update the CCA parameter contact data
-        HBufC16* link16 = HBufC16::NewLC( contactLink.Length() );
-        link16->Des().Copy( contactLink );
-        iPlugin.AppEngine()->Parameter().SetContactDataL( link16->Des() );
-        // Set contact data flag to EContactLink, because the parameters returned from 
-        // phonebook AIW provider have conatct link but not contact id.
-        iPlugin.AppEngine()->Parameter().SetContactDataFlag( MCCAParameter::EContactLink );
-        CleanupStack::PopAndDestroy(1); // link16
+        TInt length = contactLink.Length();
+        if ( length > 0 )
+            {
+            HBufC16* link16 = HBufC16::NewLC( length );
+            link16->Des().Copy( contactLink );
+            iPlugin.AppEngine()->Parameter().SetContactDataL( link16->Des() );
+            // Set contact data flag to EContactLink, because the parameters returned from 
+            // phonebook AIW provider have conatct link but not contact id.
+            iPlugin.AppEngine()->Parameter().SetContactDataFlag( MCCAParameter::EContactLink );
+            CleanupStack::PopAndDestroy(1); // link16
 
-        // Inform the app engine of the contact event
-        iPlugin.AppEngine()->CCAppContactEventL();
+            // Inform the app engine of the contact event
+            iPlugin.AppEngine()->CCAppContactEventL();
 
-        // Update the commlauncher the UI contact data
-        iPlugin.ContactHandler().RefetchContactL();
-        iPlugin.Container().ContactsChangedL();
-        
-        //Update the Store
-        SetContactStore(iPlugin.ContactHandler().ContactStore());
+            // Update the commlauncher the UI contact data
+            iPlugin.ContactHandler().RefetchContactL();
+            iPlugin.Container().ContactsChangedL();
+            
+            //Update the Store
+            SetContactStore(iPlugin.ContactHandler().ContactStore());
+            }
         }
 
     if (errParam)