Bug 806185 - Error: "caller is undefined" in ActivitiesService.jsm, line 305
authorFabrice Desré <fabrice@mozilla.com>
Tue, 30 Oct 2012 16:31:59 -0700
changeset 111972 078e5c209552a2e7494c8596464cc055939c4eef
parent 111971 58ddfb88815a8008cf2e62eb55eb4d9c8fc3b6af
child 111973 885fb1477a951e25ddca4cdd9b3e59114c212fde
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs806185
milestone19.0a1
Bug 806185 - Error: "caller is undefined" in ActivitiesService.jsm, line 305
dom/activities/src/ActivitiesService.jsm
--- a/dom/activities/src/ActivitiesService.jsm
+++ b/dom/activities/src/ActivitiesService.jsm
@@ -279,23 +279,23 @@ let Activities = {
     let msg = aMessage.json;
 
     let caller;
     let obsData;
 
     if (aMessage.name == "Activity:PostResult" ||
         aMessage.name == "Activity:PostError") {
       caller = this.callers[msg.id];
-      if (caller) {
-        obsData = JSON.stringify({ manifestURL: caller.manifestURL,
-                                   pageURL: caller.pageURL,
-                                   success: aMessage.name == "Activity:PostResult" });
-      } else {
+      if (!caller) {
         debug("!! caller is null for msg.id=" + msg.id);
+        return;
       }
+      obsData = JSON.stringify({ manifestURL: caller.manifestURL,
+                                 pageURL: caller.pageURL,
+                                 success: aMessage.name == "Activity:PostResult" });
     }
 
     switch(aMessage.name) {
       case "Activity:Start":
         this.callers[msg.id] = { mm: aMessage.target,
                                  manifestURL: msg.manifestURL,
                                  pageURL: msg.pageURL };
         this.startActivity(msg);