emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp
changeset 4 e7aa27f58ae1
parent 2 5253a20d2a1e
child 8 e1b6206813b4
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp	Tue Jan 26 11:45:42 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp	Tue Feb 02 00:02:40 2010 +0200
@@ -776,13 +776,16 @@
                              {                            
                              // Widget removed from homescreen.
                              HBufC* cid = contentid.AllocLC();
-                             TInt widgetInstance = FindWidgetInstanceId(cid->Des());                            
-                             if (!iInactive[widgetInstance])
-                                 {
-                                 iMailCpsHandler->DissociateWidgetFromSettingL( cid->Des() );                                 
-                                 iInstIdList.Remove(widgetInstance);                                 
-                                 }
-                             iAllowedToPublish[widgetInstance] = EFalse;
+                             TInt widgetInstance = FindWidgetInstanceId(cid->Des());
+                             if (widgetInstance != KErrNotFound )
+                            	 {
+								 if (!iInactive[widgetInstance])
+									 {
+									 iMailCpsHandler->DissociateWidgetFromSettingL( cid->Des() );                                 
+									 iInstIdList.Remove(widgetInstance);                                 
+									 }
+								 iAllowedToPublish[widgetInstance] = EFalse;
+                            	 }
                              CleanupStack::PopAndDestroy( cid );
                              }
                          else if (trigger.Compare(KTriggerEmailUi) == 0)