Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp |
index e1fea63aac13cc0c1b89c0460a58943a5a043df8..65d51d3846818bc299d5e0f4dfbf6b4bad07e8ca 100644 |
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp |
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp |
@@ -2308,7 +2308,11 @@ Response InspectorCSSAgent::getLayoutTreeAndStyles( |
layout_tree_nodes, |
std::unique_ptr<protocol::Array<protocol::CSS::ComputedStyle>>* |
computed_styles) { |
- dom_agent_->GetDocument()->UpdateStyleAndLayoutTree(); |
+ Document* document = dom_agent_->GetDocument(); |
+ if (!document) |
+ return Response::Error("Document is not available"); |
+ |
+ document->UpdateStyleAndLayoutTree(); |
// Look up the CSSPropertyIDs for each entry in |styleWhitelist|. |
Vector<std::pair<String, CSSPropertyID>> css_property_whitelist; |