Closed soundofspace closed 3 months ago
I'm thinking we should probably just not call the callback if there's no frame. It seems like it's just too confusing to try to handle a if a frame is already detached.
const frame = this.getFrameForExecutionContext(event.executionContextId);
if (frame) onCallback(event.payload, frame);
FramesManager addPageCallback doesn't handle an undefined frame returned by getFrameForExecutionContext.
Not entirely sure if it should ever get here if frame is undefined or it is the symptom of a larger problem. Current problem right now is that addPageCallback will call the onCallback function with frame undefined resulting in :
What worries me a bit more, but might just be my personal ide setup is that TS thinks is can't be undefined, hence not giving compile time errors (which is probably how this got under the radar).
But looking at the function is can definitely return undefined