Skip to content

Commit

Permalink
Catch if we do not have any requests
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed May 4, 2024
1 parent f7fe3bc commit 2e4478b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/engine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,13 @@ export class Engine {
const extras = await engineDelegate.getHARs();

// Backfill the fully loaded data that we extract from the HAR
if (!options.skipHar && extras.har) {
// Only do this if we actually had requests
if (!options.skipHar && extras.har && extras.har.log && extras.har.log.entries.length > 0) {

Check failure on line 339 in lib/core/engine/index.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `!options.skipHar·&&·extras.har·&&·extras.har.log·&&·extras.har.log.entries.length·>·0` with `⏎······!options.skipHar·&&⏎······extras.har·&&⏎······extras.har.log·&&⏎······extras.har.log.entries.length·>·0⏎····`
const fullyLoadedPerUrl = getFullyLoaded(extras.har);
for (let data of fullyLoadedPerUrl) {
collector.addFullyLoaded(data.url, data.fullyLoaded);
}

// Add the timings from the main document
const timings = getMainDocumentTimings(extras.har);
for (let timing of timings) {
Expand Down

0 comments on commit 2e4478b

Please sign in to comment.