Bug 804827 - bustage fix for Cu.isDeadWrapper(null) r=djf a=sicking
authorTim Taubert <ttaubert@mozilla.com>
Thu, 25 Oct 2012 01:30:14 +0200
changeset 111477 a60c5629e19b0571befbad6d18f9ffcd5822fa24
parent 111476 6c5e1a6e2e7102f55cde1fa7cb03e8d5d96643fc
child 111478 9dbdbab1e38d0d8fce2b410de3f497f4b3e3d4fa
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersdjf, sicking
bugs804827
milestone19.0a1
Bug 804827 - bustage fix for Cu.isDeadWrapper(null) r=djf a=sicking
b2g/chrome/content/forms.js
--- a/b2g/chrome/content/forms.js
+++ b/b2g/chrome/content/forms.js
@@ -38,18 +38,19 @@ let FormAssistant = {
 
   isKeyboardOpened: false,
   selectionStart: 0,
   selectionEnd: 0,
 
   _focusedElement: null,
 
   get focusedElement() {
-    if (Cu.isDeadWrapper(this._focusedElement))
+    if (this._focusedElement && Cu.isDeadWrapper(this._focusedElement))
       this._focusedElement = null;
+
     return this._focusedElement;
   },
 
   set focusedElement(val) {
     this._focusedElement = val;
   },
 
   setFocusedElement: function fa_setFocusedElement(element) {