messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp
changeset 41 25fe1fe642e3
parent 37 518b245aa84c
child 48 4f501b74aeb1
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp	Tue Jul 06 22:50:16 2010 +0530
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp	Fri Jul 09 14:46:10 2010 +0530
@@ -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;
     }