Reviewed by Darin.
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2007 02:07:17 +0000 (02:07 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2007 02:07:17 +0000 (02:07 +0000)
        Fix for <rdar://problem/5591583> CrashTracer: [USER] 157 in Mail crashes at -[WebCoreFrameBridge reapplyStylesForDeviceType:]

        * page/Frame.cpp: Add nil checks since every other caller of requestCSSStyleSheet checks for nil.
        (WebCore::UserStyleSheetLoader::UserStyleSheetLoader):
        (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28064 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/Frame.cpp

index 58191b6..9f1d849 100644 (file)
@@ -1,3 +1,13 @@
+2007-11-26  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Fix for <rdar://problem/5591583> CrashTracer: [USER] 157 in Mail crashes at -[WebCoreFrameBridge reapplyStylesForDeviceType:]
+
+        * page/Frame.cpp: Add nil checks since every other caller of requestCSSStyleSheet checks for nil.
+        (WebCore::UserStyleSheetLoader::UserStyleSheetLoader):
+        (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader):
+
 2007-11-26  Mark Rowe  <mrowe@apple.com>
 
         GCC 4.2 build fix.
index 9f4cb5b..337233c 100644 (file)
@@ -99,13 +99,16 @@ public:
         , m_cachedSheet(m_document->docLoader()->requestUserCSSStyleSheet(url, ""))
     {
         m_document->addPendingSheet();
-        m_cachedSheet->ref(this);
+        if (m_cachedSheet)
+            m_cachedSheet->ref(this);
     }
     ~UserStyleSheetLoader()
     {
-        if (!m_cachedSheet->isLoaded())
-            m_document->removePendingSheet();        
-        m_cachedSheet->deref(this);
+        if (m_cachedSheet) {
+            if (!m_cachedSheet->isLoaded())
+                m_document->removePendingSheet();        
+            m_cachedSheet->deref(this);
+        }
     }
 private:
     virtual void setCSSStyleSheet(const String& /*URL*/, const String& /*charset*/, const String& sheet)