Index: third_party/WebKit/Source/core/testing/Internals.cpp |
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp |
index 516e77e6cae6eb43cd98e2da9b08250c461bee79..34bf1b830912ff027d8882feafa153da6434f8de 100644 |
--- a/third_party/WebKit/Source/core/testing/Internals.cpp |
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp |
@@ -2293,14 +2293,16 @@ void Internals::stopTrackingRepaints(Document* document, |
void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks( |
Node* node, |
ExceptionState& exceptionState) { |
- Document* document; |
+ Document* document = nullptr; |
if (!node) { |
document = contextDocument(); |
} else if (node->isDocumentNode()) { |
document = toDocument(node); |
} else if (isHTMLIFrameElement(*node)) { |
document = toHTMLIFrameElement(*node).contentDocument(); |
- } else { |
+ } |
+ |
+ if (!document) { |
exceptionState.throwTypeError( |
"The node provided is neither a document nor an IFrame."); |
return; |