Bug 875076 - Fix undefined element error in Readability.js. r=bnicholson
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 20 Nov 2014 17:46:57 -0800
changeset 241107 13db49ad917087dc90da7d0f866052fc5498b5f5
parent 241106 5a0ffe8138d26f6a4aaa279a0dda90c624f648ac
child 241108 9b831c52c6fa1c61159d3d15013e7ed3d4e1cf25
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs875076
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 875076 - Fix undefined element error in Readability.js. r=bnicholson
mobile/android/chrome/content/Readability.js
--- a/mobile/android/chrome/content/Readability.js
+++ b/mobile/android/chrome/content/Readability.js
@@ -194,17 +194,17 @@ Readability.prototype = {
    * @return void
    **/
   _prepDocument: function() {
     let doc = this._doc;
 
     // In some cases a body element can't be found (if the HTML is
     // totally hosed for example) so we create a new body node and
     // append it to the document.
-    if (doc.body === null) {
+    if (!doc.body) {
       let body = doc.createElement("body");
 
       try {
         doc.body = body;
       } catch(e) {
         doc.documentElement.appendChild(body);
         this.log(e);
       }