Bug 583843 - Check for null in getAttribute("type") [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 02 Aug 2010 13:46:37 -0700
changeset 66423 9881ebe75e0562d11e2524242d835786a3a857ae
parent 66422 4aab8505004ea8ae226d00fe18cf8cbf8629f8eb
child 66424 0572e3c9815e58d12aed5f11bbb7400452915797
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)
reviewersmfinkle
bugs583843
Bug 583843 - Check for null in getAttribute("type") [r=mfinkle]
mobile/chrome/content/forms.js
--- a/mobile/chrome/content/forms.js
+++ b/mobile/chrome/content/forms.js
@@ -386,17 +386,17 @@ FormAssistant.prototype = {
     let element = this.currentElement;
     let list = getListForElement(element);
     return {
       current: {
         id: element.id,
         name: element.name,
         value: element.value,
         maxLength: element.maxLength,
-        type: element.getAttribute("type").toLowerCase(),
+        type: (element.getAttribute("type") || "").toLowerCase(),
         choices: list,
         isAutocomplete: this._isAutocomplete(this.currentElement),
         rect: this._getRect(),
         caretRect: this._getCaretRect()
       },
       hasPrevious: !!this._elements[this._currentIndex - 1],
       hasNext: !!this._elements[this._currentIndex + 1]
     };