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(); |