Skip to content

Commit 008fd2f

Browse files
authored
ignore mapping if line is not set (#208)
1 parent 106819d commit 008fd2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/getMapping.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const { SourceMapConsumer } = require('source-map');
88
*/
99
module.exports = function getMapping(sourceMap, location) {
1010
/* istanbul ignore if: edge case too hard to test for with babel malformation */
11-
if (location.start.line < 1 || location.start.column < 0) {
11+
if (!location.start.line || location.start.line < 1 || location.start.column < 0) {
1212
return null;
1313
}
1414
/* istanbul ignore if: edge case too hard to test for with babel malformation */
15-
if (location.end.line < 1 || location.end.column < 0) {
15+
if (!location.end.line || location.end.line < 1 || location.end.column < 0) {
1616
return null;
1717
}
1818

0 commit comments

Comments
 (0)