Reviewed by Darin.
[WebKit-https.git] / WebCore / page / Frame.cpp
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)