This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -663,18 +663,25 @@ func (fs *FrameSession) onExecutionContextCreated(event *cdpruntime.EventExecuti
663663 if err := json .Unmarshal (auxData , & i ); err != nil {
664664 k6ext .Panic (fs .ctx , "unmarshaling executionContextCreated event JSON: %w" , err )
665665 }
666- var world executionWorld
666+
667667 frame , ok := fs .manager .getFrameByID (i .FrameID )
668- if ok {
669- if i .IsDefault {
670- world = mainWorld
671- } else if event .Context .Name == utilityWorldName && ! frame .hasContext (utilityWorld ) {
672- // In case of multiple sessions to the same target, there's a race between
673- // connections so we might end up creating multiple isolated worlds.
674- // We can use either.
675- world = utilityWorld
676- }
668+ if ! ok {
669+ fs .logger .Debugf ("FrameSession:onExecutionContextCreated:return" ,
670+ "sid:%v tid:%v ectxid:%d missing frame" ,
671+ fs .session .ID (), fs .targetID , event .Context .ID )
672+ return
677673 }
674+
675+ var world executionWorld
676+ if i .IsDefault {
677+ world = mainWorld
678+ } else if event .Context .Name == utilityWorldName && ! frame .hasContext (utilityWorld ) {
679+ // In case of multiple sessions to the same target, there's a race between
680+ // connections so we might end up creating multiple isolated worlds.
681+ // We can use either.
682+ world = utilityWorld
683+ }
684+
678685 if i .Type == "isolated" {
679686 fs .isolatedWorlds [event .Context .Name ] = true
680687 }
You can’t perform that action at this time.
0 commit comments