Skip to content

Commit

Permalink
fix: don't throw when there are no sources as part of the sourcemap
Browse files Browse the repository at this point in the history
Closes #15
  • Loading branch information
mattlewis92 authored Apr 30, 2017
1 parent ab837d0 commit 4fc5311
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function fixWebpackFilePath(filePath) {

function fixWebpackSourcePaths(sourceMap) {
return Object.assign({}, sourceMap, {
sources: sourceMap.sources.map(source => {
sources: (sourceMap.sources || []).map(source => {
source = fixWebpackFilePath(source);
if (sourceMap.sourceRoot && source.startsWith(sourceMap.sourceRoot)) {
source = source.replace(sourceMap.sourceRoot, '');
Expand Down

0 comments on commit 4fc5311

Please sign in to comment.