Bug 803385. Make sure cookie value is not undefined before trying to trim it. r=felipe
authorJared Wein <jwein@mozilla.com>
Fri, 19 Oct 2012 17:16:24 -0700
changeset 110967 9af9ca79f02667fa7e4927f33283a3e1666ae366
parent 110966 9e4c7538d6a96b42da832fff0209aaaf16d7c6a7
child 110968 4ae3fd8d62f477b4a8ce0c5bf52ad661d5525846
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersfelipe
bugs803385
milestone19.0a1
Bug 803385. Make sure cookie value is not undefined before trying to trim it. r=felipe
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");
     },