From f349dbaa006f85f82c4d0e68837b57d8fa1a4adb Mon Sep 17 00:00:00 2001 From: Jianzhou Feng Date: Tue, 2 Jan 2018 20:14:28 -0800 Subject: [PATCH] throw error when TracingStartedInPage is missing --- lighthouse-core/gather/computed/trace-of-tab.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lighthouse-core/gather/computed/trace-of-tab.js b/lighthouse-core/gather/computed/trace-of-tab.js index 628ea8d7fe67..8b45c4bf2395 100644 --- a/lighthouse-core/gather/computed/trace-of-tab.js +++ b/lighthouse-core/gather/computed/trace-of-tab.js @@ -51,6 +51,7 @@ class TraceOfTab extends ComputedArtifact { // The first TracingStartedInPage in the trace is definitely our renderer thread of interest // Beware: the tracingStartedInPage event can appear slightly after a navigationStart const startedInPageEvt = keyEvents.find(e => e.name === 'TracingStartedInPage'); + if (!startedInPageEvt) throw new Error('TracingStartedInPage was not found in the trace'); // Filter to just events matching the frame ID for sanity const frameEvents = keyEvents.filter(e => e.args.frame === startedInPageEvt.args.data.page);