Index: Source/core/css/CSSStyleSheet.cpp |
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp |
index 42fcb47534f9b0d73e4157eb5ea9fe528339091e..1d0336a5c5a0d6342a1173457e7bafa96b4ae1cf 100644 |
--- a/Source/core/css/CSSStyleSheet.cpp |
+++ b/Source/core/css/CSSStyleSheet.cpp |
@@ -162,7 +162,8 @@ void CSSStyleSheet::willMutateRules() |
// If we are the only client it is safe to mutate. |
if (m_contents->clientSize() <= 1 && !m_contents->isInMemoryCache()) { |
m_contents->clearRuleSet(); |
- m_contents->removeSheetFromCache(ownerDocument()); |
+ if (Document* document = ownerDocument()) |
+ m_contents->removeSheetFromCache(document); |
m_contents->setMutable(); |
return; |
} |