From aa00cd69465786fff657520175ef37953add6028 Mon Sep 17 00:00:00 2001 From: "mostafah%oeone.com" Date: Fri, 18 Jun 2004 21:54:48 +0000 Subject: [PATCH] Fixed crash on TB 0.7 and FF 0.9 git-svn-id: svn://10.0.0.236/trunk@158148 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/calendar/libxpical/oeICalImpl.cpp | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/mozilla/calendar/libxpical/oeICalImpl.cpp b/mozilla/calendar/libxpical/oeICalImpl.cpp index caac305416c..303a9a02f33 100644 --- a/mozilla/calendar/libxpical/oeICalImpl.cpp +++ b/mozilla/calendar/libxpical/oeICalImpl.cpp @@ -1786,20 +1786,22 @@ NS_IMETHODIMP UpdateCalendarIcon( PRBool hasAlarm ) windowEnumerator->GetNext(getter_AddRefs(nextWindow)); nsCOMPtr domWindow(do_QueryInterface(nextWindow)); - nsCOMPtr domDocument; - domWindow->GetDocument(getter_AddRefs(domDocument)); + if( domWindow ) { + nsCOMPtr domDocument; + domWindow->GetDocument(getter_AddRefs(domDocument)); - if(domDocument) - { - nsCOMPtr domElement; - domDocument->GetElementById(NS_LITERAL_STRING("mini-cal"), getter_AddRefs(domElement)); + if(domDocument) + { + nsCOMPtr domElement; + domDocument->GetElementById(NS_LITERAL_STRING("mini-cal"), getter_AddRefs(domElement)); - if (domElement) { - if ( hasAlarm ) { - domElement->SetAttribute(NS_LITERAL_STRING("BiffState"), NS_LITERAL_STRING("Alarm")); - } - else { - domElement->RemoveAttribute(NS_LITERAL_STRING("BiffState")); + if (domElement) { + if ( hasAlarm ) { + domElement->SetAttribute(NS_LITERAL_STRING("BiffState"), NS_LITERAL_STRING("Alarm")); + } + else { + domElement->RemoveAttribute(NS_LITERAL_STRING("BiffState")); + } } } }