Commits

Mathieu Henri committed 8bbc39c

Fix for CORE-46994 - Missing check for untracked frameID in cls.ResourceContext.update

  • Participants
  • Parent commits 2550ae1

Comments (0)

Files changed (1)

src/resource-manager/resource_service.js

       res.frameID = event.frameID;
       this.resourcesDict[ res.id ] = res;
     }
-    else if (!res)
+
+    if (res)
     {
-      // ignoring. Never saw an urlload, or it's allready invalidated
-      return;
-    }
+      res.update(eventname, event);
 
-    res.update(eventname, event);
+      if (eventname == "urlfinished")
+      {
+        // push the resourceID into the proper group
+        var frame = this.frames[res.frameID];
+        if (frame)
+        {
+          var type = res.type;
+          if (!frame.groups[type]){ type='other'; }
 
-    if (res.invalid)
-    {
-      delete this.resourcesDict[ res.id ];
-    }
-    else if (eventname == "urlfinished")
-    {
-      // push the resourceID into the proper group
-      var frame = this.frames[res.frameID];
-      var type = res.type;
-      if (!frame.groups[type]){ type='other'; }
+          frame.groups[type].push( res.id );
+          this.resourcesUrlDict[ res.url ] = res.id;
+        }
+        else
+        {
+          res.invalid = true;
+        }
+      }
 
-      frame.groups[type].push( res.id );
-      this.resourcesUrlDict[ res.url ] = res.id;
+      if (res.invalid)
+      {
+        delete this.resourcesDict[ res.id ];
+        return;
+      }
 
       return res;
     }
+
   }
 
   this.get_resource = function(id)