Skip to content

Commit 2661428

Browse files
micmrosoulgalore
authored andcommitted
#244 add check if startRelative is valid (#245)
else skip and add warning in console
1 parent 8d559a1 commit 2661428

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/ts/transformers/har.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ export function transformPage(harData: Har | Log,
121121
})
122122
.map((entry, index) => {
123123
const startRelative = new Date(entry.startedDateTime).getTime() - pageStartTime;
124-
doneTime = Math.max(doneTime, startRelative + entry.time);
124+
if (!isNaN(startRelative)) {
125+
doneTime = Math.max(doneTime, startRelative + entry.time);
126+
} else {
127+
// tslint:disable-next-line:no-console
128+
console.warn(`Entry has no valid 'startedDateTime' time`, entry.request.url, entry);
129+
}
125130
return toWaterFallEntry(entry, index, startRelative, isTLS);
126131
});
127132

0 commit comments

Comments
 (0)