Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index 9c73cbac6ab4afb45ac886dc77914bf1bbfdf3e8..fceb6652aed8561eb7a9b867e323fd0799e1c87a 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -5289,8 +5289,10 @@ KURL Document::OpenSearchDescriptionURL() { |
void Document::currentScriptForBinding( |
HTMLScriptElementOrSVGScriptElement& script_element) const { |
- if (!current_script_stack_.IsEmpty()) |
- current_script_stack_.back()->SetScriptElementForBinding(script_element); |
+ if (!current_script_stack_.IsEmpty()) { |
+ if (ScriptElementBase* script_element_base = current_script_stack_.back()) |
+ script_element_base->SetScriptElementForBinding(script_element); |
+ } |
} |
void Document::PushCurrentScript(ScriptElementBase* new_current_script) { |