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")); + } } } }