| Index: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
|
| index 4b7917c1613d328f0a1f99a3bc7ee7fca05644b9..ce58e04b879885d37f0d35f446785dac353412c6 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
|
| @@ -392,10 +392,10 @@ WebInspector.TextPrompt.prototype = {
|
| {
|
| this.clearAutoComplete(true);
|
| var selection = this._element.getComponentSelection();
|
| - if (!selection.rangeCount)
|
| + var selectionRange = selection && selection.rangeCount ? selection.getRangeAt(0) : null;
|
| + if (!selectionRange)
|
| return;
|
|
|
| - var selectionRange = selection.getRangeAt(0);
|
| var shouldExit;
|
|
|
| if (!force && !this.isCaretAtEndOfPrompt() && !this.isSuggestBoxVisible())
|
| @@ -684,10 +684,10 @@ WebInspector.TextPrompt.prototype = {
|
| isCaretAtEndOfPrompt: function()
|
| {
|
| var selection = this._element.getComponentSelection();
|
| - if (!selection.rangeCount || !selection.isCollapsed)
|
| + var selectionRange = selection && selection.rangeCount ? selection.getRangeAt(0) : null;
|
| + if (!selectionRange || !selection.isCollapsed)
|
| return false;
|
|
|
| - var selectionRange = selection.getRangeAt(0);
|
| var node = selectionRange.startContainer;
|
| if (!node.isSelfOrDescendant(this._element))
|
| return false;
|
|
|