From 55e6b6e7fc7265a4d29e6a1e4fa70e9b42f8bf49 Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Thu, 4 May 2006 18:29:33 +0000 Subject: [PATCH] bug 335879: treat unknown timezones as floating, to prevent the app from dying. r=dmose --- calendar/base/src/calDateTime.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/calendar/base/src/calDateTime.cpp b/calendar/base/src/calDateTime.cpp index 5af509893f63..f0fb33e47ba2 100644 --- a/calendar/base/src/calDateTime.cpp +++ b/calendar/base/src/calDateTime.cpp @@ -626,8 +626,15 @@ calDateTime::GetIcalTZ(const nsACString& tzid, struct _icaltimezone **tzp) nsCOMPtr tz; nsresult rv = ics->GetTimezone(tzid, getter_AddRefs(tz)); - if (NS_FAILED(rv) || !tz) - return NS_ERROR_INVALID_ARG; + if (NS_FAILED(rv) || !tz) { + // No timezone was found. To prevent the app from dying, + // pretent that there is no timezone, ie return floating. + // See bug 335879 + *tzp = nsnull; + return NS_OK; + // We should return an error, but don't: + //return NS_ERROR_INVALID_ARG; + } if (tzp) { icalcomponent *zonecomp = tz->GetIcalComponent();