Bug 492804 - remove hasAnno check for bookmark description, r=mak77
authorDietrich Ayala <dietrich@mozilla.com>
Tue, 19 May 2009 01:06:55 +0200
changeset 28517 95e15728ccae554eb1a21accef61105f5ff3f6ca
parent 28516 259b8094d8277254bebc4f41a5e184b0b8c0f22e
child 28518 652accbde6833fbc99b908c726edc8eb5c7a23e5
push id7104
push usermak77@bonardo.net
push dateMon, 18 May 2009 23:07:39 +0000
treeherdermozilla-central@652accbde683 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak77
bugs492804
milestone1.9.2a1pre
Bug 492804 - remove hasAnno check for bookmark description, r=mak77
browser/components/places/content/treeView.js
--- a/browser/components/places/content/treeView.js
+++ b/browser/components/places/content/treeView.js
@@ -1179,19 +1179,23 @@ PlacesTreeView.prototype = {
         return "";
       case this.COLUMN_TYPE_VISITCOUNT:
         return node.accessCount;
       case this.COLUMN_TYPE_KEYWORD:
         if (PlacesUtils.nodeIsBookmark(node))
           return PlacesUtils.bookmarks.getKeywordForBookmark(node.itemId);
         return "";
       case this.COLUMN_TYPE_DESCRIPTION:
-        const annos = PlacesUtils.annotations;
-        if (annos.itemHasAnnotation(node.itemId, DESCRIPTION_ANNO))
-          return annos.getItemAnnotation(node.itemId, DESCRIPTION_ANNO)
+        if (node.itemId != -1) {
+          try {
+            return PlacesUtils.annotations.
+                               getItemAnnotation(node.itemId, DESCRIPTION_ANNO);
+          }
+          catch (ex) { /* has no description */ }
+        }
         return "";
       case this.COLUMN_TYPE_DATEADDED:
         if (node.dateAdded)
           return this._convertPRTimeToString(node.dateAdded);
         return "";
       case this.COLUMN_TYPE_LASTMODIFIED:
         if (node.lastModified)
           return this._convertPRTimeToString(node.lastModified);