Bug 803385. Make sure cookie value is not undefined before trying to trim it. r=felipe a=gavin
authorJared Wein <jwein@mozilla.com>
Fri, 19 Oct 2012 17:18:06 -0700
changeset 109603 5152b00790f94ab5ce1f65f3edec12914af16528
parent 109602 106c005654e575488c89810023cba181ee943e0d
child 109604 3480249b8b76897d3ffacf0aa455cabde51218ce
push id1571
push userfelipc@gmail.com
push dateSat, 20 Oct 2012 00:18:42 +0000
treeherdermozilla-beta@3480249b8b76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, gavin
bugs803385
milestone17.0
Bug 803385. Make sure cookie value is not undefined before trying to trim it. r=felipe a=gavin
toolkit/components/social/WorkerAPI.jsm
--- a/toolkit/components/social/WorkerAPI.jsm
+++ b/toolkit/components/social/WorkerAPI.jsm
@@ -64,17 +64,17 @@ WorkerAPI.prototype = {
     },
     "social.cookies-get": function(data) {
       let document = this._port._window.document;
       let cookies = document.cookie.split(";");
       let results = [];
       cookies.forEach(function(aCookie) {
         let [name, value] = aCookie.split("=");
         results.push({name: unescape(name.trim()),
-                      value: unescape(value.trim())});
+                      value: value ? unescape(value.trim()) : ""});
       });
       this._port.postMessage({topic: "social.cookies-get-response",
                               data: results});
     },
     'social.request-chat': function(data) {
       let xulWindow = Services.wm.getMostRecentWindow("navigator:browser").getTopWin();
       openChatWindow(xulWindow, this._provider, data, null, "minimized");
     },