Bug 264482 - Followup to add missing null check. r=mkmelin
authoralta88@gmail.com
Tue, 05 Nov 2013 11:47:33 -0700
changeset 16870 d4659a7cf923e736c2bea20ccdee08dbe9899069
parent 16869 d4c74466ca8146d18b19d4cceb0a03d0891dfab8
child 16871 e3deddef504b75641d4ac67ca67e2c7740ee30bd
push id1074
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:47:23 +0000
treeherdercomm-beta@6b791b5369ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs264482
Bug 264482 - Followup to add missing null check. r=mkmelin
mailnews/extensions/newsblog/content/feed-parser.js
--- a/mailnews/extensions/newsblog/content/feed-parser.js
+++ b/mailnews/extensions/newsblog/content/feed-parser.js
@@ -178,17 +178,19 @@ FeedParser.prototype =
 
       if (!item.id)
       {
         // At this point, if there is no guid, uniqueness cannot be guaranteed
         // by any of link or date (optional) or title (optional unless there
         // is no description). Use a big chunk of description; minimize dupes
         // with url and title if present.
         item.id = (item.url || item.feed.url) + "#" + item.title + "#" +
-                  (this.stripTags(item.description.substr(0, 150)) || item.title);
+                  (this.stripTags(item.description ?
+                                    item.description.substr(0, 150) : null) ||
+                   item.title);
         item.id = item.id.replace(/[\n\r\t\s]+/g, " ");
       }
 
       if (!item.title)
         item.title = this.stripTags(item.description).substr(0, 150);
 
       tags = this.childrenByTagNameNS(itemNode, nsURI, "author");
       if (!tags)