rem: var selectedItem = engineListSelection.length ? engineListSelection[0] : null; 
add: var selectedItem = engineListSelection.item(0); 
context: function checkEngine(){  var engineList = document.getElementById("engineList");  var engineValue = engineList.label;    //nothing is selected  if (!engineValue)  {    try    {        var strDefaultSearchEngineName = parent.hPrefWindow.getPref("localizedstring", "browser.search.defaultenginename");        var engineListSelection = engineList.getElementsByAttribute( "label", strDefaultSearchEngineName );        var selectedItem = engineListSelection.length ? engineListSelection[0] : null;            if (selectedItem)        {            //select a locale-dependent predefined search engine in absence of a user default            engineList.selectedItem = selectedItem;        }        else        {            //select the first listed search engine            engineList.selectedIndex = 1;        }    }    catch(e)    {        //select the first listed search engine        engineList.selectedIndex = 1;    }  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/416b1bf35e26e549b9ba3728c9c72e1bfec93b42/pref-search.js/buggy/suite/common/pref/pref-search.js