From 008fd2f9b358311cc297111fe7baaf367e56e92e Mon Sep 17 00:00:00 2001 From: Sascha Kiefer Date: Thu, 14 Apr 2022 14:30:48 +0200 Subject: [PATCH] ignore mapping if line is not set (#208) --- lib/getMapping.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/getMapping.js b/lib/getMapping.js index 785e3ed..1aaa51b 100644 --- a/lib/getMapping.js +++ b/lib/getMapping.js @@ -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; }