Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: Source/core/html/HTMLLabelElement.cpp

Issue 288933002: Fix crash after detaching document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added Layout test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLLabelElement.cpp
diff --git a/Source/core/html/HTMLLabelElement.cpp b/Source/core/html/HTMLLabelElement.cpp
index b625e78f6d1c03e85537220ce833a8da5c2d4f3e..13ca30e6b67ee2cdf7624d7be1bfc9d5a188adaa 100644
--- a/Source/core/html/HTMLLabelElement.cpp
+++ b/Source/core/html/HTMLLabelElement.cpp
@@ -140,8 +140,10 @@ void HTMLLabelElement::defaultEventHandler(Event* evt)
if (evt->type() == EventTypeNames::click && !processingClick) {
// If text of label element is selected, do not pass
// the event to control element.
- if (document().frame()->selection().selection().isRange())
- return;
+ if (LocalFrame* frame = document().frame()) {
+ if (frame->selection().selection().isRange())
+ return;
+ }
RefPtrWillBeRawPtr<HTMLElement> element = control();

Powered by Google App Engine
This is Rietveld 408576698