calendarui/controller/src/calenalarmmanager.cpp
branchRCL_3
changeset 78 356f28cd5ca0
parent 66 bd7edf625bdd
child 86 ed599363c2d7
--- a/calendarui/controller/src/calenalarmmanager.cpp	Tue Sep 14 21:17:03 2010 +0300
+++ b/calendarui/controller/src/calenalarmmanager.cpp	Wed Sep 15 12:11:35 2010 +0300
@@ -1060,7 +1060,7 @@
     TRACE_ENTRY_POINT;
 
     TTime currentTime = CalenDateUtils::Now();
-    TTime entryAlarmTime; 
+    TTime entryAlarmTime(Time::NullTTime()); 
     RArray<TCalLocalUid> foundlocalUids;
     RArray<TCalCollectionId> foundColIds;
     TCalLocalUid entryLocalUid;
@@ -1123,25 +1123,29 @@
     
     // FIXME: leaving!
     CCalAlarm* alarm = aEntry.AlarmL();
-    CleanupStack::PushL( alarm );
-
-    switch( aEntry.EntryTypeL() )
+    
+    if(alarm)
         {
-        case CCalEntry::ETodo:
-            aAlarmDateTime = aEntry.EndTimeL().TimeLocalL();
-            break;
+        CleanupStack::PushL( alarm );
+
+        switch( aEntry.EntryTypeL() )
+            {
+            case CCalEntry::ETodo:
+                aAlarmDateTime = aEntry.EndTimeL().TimeLocalL();
+                break;
 
-        case CCalEntry::EAppt:
-        case CCalEntry::EEvent:
-        case CCalEntry::EAnniv:
-        default:
-            aAlarmDateTime = aEntry.StartTimeL().TimeLocalL();
-            break;
+            case CCalEntry::EAppt:
+            case CCalEntry::EEvent:
+            case CCalEntry::EAnniv:
+            default:
+                aAlarmDateTime = aEntry.StartTimeL().TimeLocalL();
+                break;
+            }
+        aAlarmDateTime -= alarm->TimeOffset();
+
+        CleanupStack::PopAndDestroy( alarm );
         }
-    aAlarmDateTime -= alarm->TimeOffset();
-    
-    CleanupStack::PopAndDestroy( alarm );
-
+   
     TRACE_EXIT_POINT;
     }