diff --git a/extensions/wallet/cookieviewer/CookieViewer.js b/extensions/wallet/cookieviewer/CookieViewer.js index 12db6bf5f82d..c5d7792c7d84 100644 --- a/extensions/wallet/cookieviewer/CookieViewer.js +++ b/extensions/wallet/cookieviewer/CookieViewer.js @@ -95,14 +95,14 @@ function CreateCookieList() // purpose : an home-brewed object that represents a individual cookie in the stream function Cookie(number,name,value,domaintype,domain,path,secure,expire) { - this.number = ( number ) ? number : null; - this.name = ( name ) ? name : null; - this.value = ( value ) ? value : null; - this.domaintype = ( domaintype ) ? domaintype : null; - this.domain = ( domain ) ? domain : null; - this.path = ( path ) ? path : null; - this.secure = ( secure ) ? secure : null; - this.expire = ( expire ) ? expire : null; + this.number = (arguments.length) ? number : null; + this.name = (arguments.length) ? name : null; + this.value = (arguments.length) ? value : null; + this.domaintype = (arguments.length) ? domaintype : null; + this.domain = (arguments.length) ? domain : null; + this.path = (arguments.length) ? path : null; + this.secure = (arguments.length) ? secure : null; + this.expire = (arguments.length) ? expire : null; } @@ -138,12 +138,12 @@ function ViewCookieSelected( e ) if( cookietree.selectedItems.length ) document.getElementById("removeCookies").removeAttribute("disabled","true"); - if( e.type == "keypress" || e.type == "select" ) + if( ( e.type == "keypress" || e.type == "select" ) && e.target.selectedItems.length ) cookie = cookietree.selectedItems[0]; if( e.type == "click" ) cookie = e.target.parentNode.parentNode; - if(cookie.getAttribute("id").indexOf("tree_") == -1) + if( !cookie || cookie.getAttribute("id").indexOf("tree_") == -1) return false; var idx = parseInt(cookie.getAttribute("id").substring(5,cookie.getAttribute("id").length)); for (x=0; x