messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp
changeset 52 12db4185673b
parent 43 35b64624a9e7
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp	Tue Jul 06 14:12:40 2010 +0300
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp	Wed Aug 18 09:45:25 2010 +0300
@@ -52,11 +52,11 @@
     
     if(attachmentProcessed == EFalse && iAttachmentCount == 1)
     {
-        CMsvStore* store = iMsvEntry->EditStoreL();
+       TRAP_IGNORE( CMsvStore* store = iMsvEntry->EditStoreL();
         CleanupStack::PushL(store);
         MMsvAttachmentManagerSync& attachMan = store->AttachmentManagerExtensionsL();
         attachMan.RemoveAttachmentL(0);
-        CleanupStack::PopAndDestroy();
+        CleanupStack::PopAndDestroy(););
     }
     
     if (iMsvEntry) {
@@ -75,7 +75,7 @@
 //---------------------------------------------------------------
 UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate(UniBioMessageDataPlugin* plugin) :
     q_ptr(plugin), iMSession(NULL), iMtmReg(NULL), iBioClientMtm(NULL),
-            iMsvEntry(NULL)
+            iMsvEntry(NULL),iAttachmentCount(0)
 {
     iMSession = CMsvSession::OpenSyncL(*this);
     done = EFalse;
@@ -247,7 +247,13 @@
         CMsvStore* store1 = iMsvEntry->ReadStoreL();
         CleanupStack::PushL(store1);
         MMsvAttachmentManager& attachMan = store1->AttachmentManagerL();
-        RFile file = attachMan.GetAttachmentFileL(0);
+        RFile file;
+		
+        if (iAttachmentCount > 0)
+        {
+            file = attachMan.GetAttachmentFileL(0);
+        }
+            
         CleanupStack::PopAndDestroy(store1);
         return file;
     }