Bug 712698 - view.selection is null in error console when starting Firefox with about:config in a tab. r=Mossop
authorTobias Markus <tobbi.bugs@googlemail.com>
Wed, 21 Dec 2011 19:37:20 +0100
changeset 84910 79b42c063508b0c5c584d9ae38b1a30f5f78c49c
parent 84909 93d49e745ff710081763774ffdb6cfffe23966d3
child 84911 da39e7b9896767fd741a152dca9e0f9b4444e923
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs712698
milestone12.0a1
Bug 712698 - view.selection is null in error console when starting Firefox with about:config in a tab. r=Mossop
toolkit/components/viewconfig/content/config.js
--- a/toolkit/components/viewconfig/content/config.js
+++ b/toolkit/components/viewconfig/content/config.js
@@ -457,17 +457,18 @@ function FilterPrefs()
   }
   else if (substring) {
     gFilter = RegExp(substring.replace(/([^* \w])/g, "\\$1")
                               .replace(/^\*+/, "").replace(/\*+/g, ".*"), "i");
   } else {
     gFilter = null;
   }
 
-  var prefCol = view.selection.currentIndex < 0 ? null : gPrefView[view.selection.currentIndex].prefCol;
+  var prefCol = (view.selection && view.selection.currentIndex < 0) ?
+                null : gPrefView[view.selection.currentIndex].prefCol;
   var oldlen = gPrefView.length;
   gPrefView = gPrefArray;
   if (gFilter) {
     gPrefView = [];
     for (var i = 0; i < gPrefArray.length; ++i)
       if (gFilter.test(gPrefArray[i].prefCol + ";" + gPrefArray[i].valueCol))
         gPrefView.push(gPrefArray[i]);
   }