From 009eab52477c3dcdf4da345bad3cfe1171c17250 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Fri, 19 Jul 2024 11:11:51 +0200 Subject: [PATCH] Catch if the HAR miss the URL (#2160) --- lib/core/engine/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/core/engine/index.js b/lib/core/engine/index.js index c4dd56690..c61c4b7a2 100644 --- a/lib/core/engine/index.js +++ b/lib/core/engine/index.js @@ -344,7 +344,13 @@ export class Engine { ) { const fullyLoadedPerUrl = getFullyLoaded(extras.har); for (let data of fullyLoadedPerUrl) { - collector.addFullyLoaded(data.url, data.fullyLoaded); + if (data.url === undefined) { + log.error( + 'There is an page without an URL in the HAR. Please inspect the HAR file and check whats wrong' + ); + } else { + collector.addFullyLoaded(data.url, data.fullyLoaded); + } } // Add the timings from the main document