Bug 637808 - Focusing on a text field element may give you a console error [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Wed, 02 Mar 2011 08:17:43 -0500
changeset 67451 ecd2aa68a6bb0bb5dd738277b9d8865e1e5df7c8
parent 67450 d62c1de9a231160f1673d4e4a4009e07886f8d41
child 67452 ba63a2eca07d1fbc62eef7493e62ffdd0dece1b8
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs637808
Bug 637808 - Focusing on a text field element may give you a console error [r=vingtetun]
mobile/chrome/content/common-ui.js
--- a/mobile/chrome/content/common-ui.js
+++ b/mobile/chrome/content/common-ui.js
@@ -746,17 +746,17 @@ var FormHelperUI = {
           aEvent.preventDefault();
           aEvent.stopPropagation();
           return;
         }
 
         // If the focus is not on the browser element, the key will not be sent
         // to the content so do it ourself
         let focusedElement = gFocusManager.getFocusedElementForWindow(window, true, {});
-        if (focusedElement.localName == "browser")
+        if (focusedElement && focusedElement.localName == "browser")
           return;
 
         Browser.keySender.handleEvent(aEvent);
         break;
 
       case "SizeChanged":
         setTimeout(function(self) {
           SelectHelperUI.sizeToContent();