Skip to content

Commit

Permalink
ignore mapping if line is not set (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
esskar authored Apr 14, 2022
1 parent 106819d commit 008fd2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/getMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const { SourceMapConsumer } = require('source-map');
*/
module.exports = function getMapping(sourceMap, location) {
/* istanbul ignore if: edge case too hard to test for with babel malformation */
if (location.start.line < 1 || location.start.column < 0) {
if (!location.start.line || location.start.line < 1 || location.start.column < 0) {
return null;
}
/* istanbul ignore if: edge case too hard to test for with babel malformation */
if (location.end.line < 1 || location.end.column < 0) {
if (!location.end.line || location.end.line < 1 || location.end.column < 0) {
return null;
}

Expand Down

0 comments on commit 008fd2f

Please sign in to comment.