From 54267646850379711ade7328c737f2b0dad7a749 Mon Sep 17 00:00:00 2001 From: "mostafah%oeone.com" Date: Mon, 1 Nov 2004 21:52:09 +0000 Subject: [PATCH] Checked in patch for bug 257943 ( using year == -1 ): Crash after adding a new task : invalid DTSTART entry --- calendar/libxpical/oeICalEventImpl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/calendar/libxpical/oeICalEventImpl.cpp b/calendar/libxpical/oeICalEventImpl.cpp index adb96d2d2139..e1b42fdf146a 100644 --- a/calendar/libxpical/oeICalEventImpl.cpp +++ b/calendar/libxpical/oeICalEventImpl.cpp @@ -1226,6 +1226,16 @@ icaltimetype oeICalEventImpl::GetNextAlarmTime( icaltimetype begin ) { if( !m_hasalarm ) return result; + // Check for related to the start, and no start set + // or a start year set to -1, which might occur for invalid start times + // due to timezone weirdness + PRBool isSet = PR_FALSE; + m_start->GetIsSet(&isSet); + PRInt16 year; + m_start->GetYear(&year); + if( m_alarmtriggerrelation == ICAL_RELATED_START && (!isSet || year == -1) ) + return result; + icaltimetype starting = begin; if( !icaltime_is_null_time( m_lastalarmack ) && icaltime_compare( begin, m_lastalarmack ) < 0 )