Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

making sure bp.actual location is not null/undefined before trying to access its line number #381

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/chrome/breakOnLoadHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export class BreakOnLoadHelper {
// Important: We need to get the committed breakpoints only after all the pending breakpoints for this file have been resolved. If not this logic won't work
const committedBps = this._chromeDebugAdapter.committedBreakpointsByUrl.get(pausedScriptUrl) || [];
const anyBreakpointsAtPausedLocation = committedBps.filter(bp =>
bp.actualLocation.lineNumber === pausedLocation.lineNumber && bp.actualLocation.columnNumber === pausedLocation.columnNumber).length > 0;
// Important: Chrome devtools-protocol can return an empty locations array, resulting in 'undefined' for the actualLocation, so we have to check an actualLocation exists
bp.actualLocation &&
bp.actualLocation.lineNumber === pausedLocation.lineNumber &&
bp.actualLocation.columnNumber === pausedLocation.columnNumber).length > 0;

// If there were any breakpoints at this location (Which generally should be (1,1)) we shouldn't continue
if (anyBreakpointsAtPausedLocation) {
Expand Down