Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Improve null handling of responses in requestfinished
Browse files Browse the repository at this point in the history
Apparently puppeteer can race on this
  • Loading branch information
turt2live committed Mar 11, 2022
1 parent 060209f commit 3fc7368
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/end-to-end-tests/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ElementSession {
"requestfinished", async (req: puppeteer.HTTPRequest) => {
const type = req.resourceType();
const response = await req.response();
return `${type} ${response.status()} ${req.method()} ${req.url()} \n`;
return `${type} ${response?.status() ?? '<no response>'} ${req.method()} ${req.url()} \n`;
});
this.log = new Logger(this.username);
}
Expand Down

0 comments on commit 3fc7368

Please sign in to comment.