Skip to content

[Bug]: frame needs a null checking #7749

Closed
@kura5

Description

Bug description

frame._client || this._client,

If frame is null, it will throw an exception even though it is not necessary.

Puppeteer version

11.0.0

Node.js version

16.13.0

npm version

8.1.2

What operating system are you seeing the problem on?

Windows

Relevant log output

C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:334
        const context = new ExecutionContext_js_1.ExecutionContext(frame._client || this._client, contextPayload, world);
                                                                         ^
TypeError: Cannot read properties of null (reading '_client')
    at FrameManager._onExecutionContextCreated (C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:334:74)
    at C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:76:18
    at C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\vendor\mitt\src\index.js:51:62
    at Array.map (<anonymous>)
    at Object.emit (C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\vendor\mitt\src\index.js:51:43)
    at CDPSession.emit (C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\common\EventEmitter.js:72:22)
    at CDPSession._onMessage (C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:245:18)
    at Connection._onMessage (C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:117:25)
    at WebSocket.<anonymous> (C:\Users\foo\tmp\test\node_modules\puppeteer\lib\cjs\puppeteer\node\NodeWebSocketTransport.js:13:32)
    at WebSocket.onMessage (C:\Users\foo\tmp\test\node_modules\puppeteer\node_modules\ws\lib\event-target.js:199:18)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions