Skip to content

fix/450 null source guard - #563

Open
user-Param wants to merge 2 commits into
mozilla:masterfrom
user-Param:fix/450-null-source-guard
Open

user-Param wants to merge 2 commits into
mozilla:masterfrom
user-Param:fix/450-null-source-guard

Conversation

@user-Param

Copy link
Copy Markdown

In IndexedSourceMapConsumer.generatedPositionFor, allGeneratedPositionsFor,
and eachMapping, the section-boundary check compared the section-relative
generated line against the next section's absolute generated line offset
before applying lineShift. This meant the clamp never triggered for sections
with a nonzero line offset, leaving lastColumn as Infinity.

Fixes mozilla#542 and mozilla#539.
…ceContentFor (mozilla#450)

Add null/undefined checks at the start of _findSourceIndex and both
sourceContentFor implementations. When aSource is null or undefined
(e.g. from an unprocessed HTTP query parameter), return -1 or null
instead of potentially throwing 'Cannot read property indexOf of null'.

Fixes mozilla#450.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants