From e26f9940753184cfb5ac111d3b8f42db30414d80 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 29 Mar 2015 17:17:43 +1100 Subject: [PATCH] add existence check when merging source map - fixes #1111 --- src/babel/transformation/file/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/babel/transformation/file/index.js b/src/babel/transformation/file/index.js index b180a96296..71598a46a7 100644 --- a/src/babel/transformation/file/index.js +++ b/src/babel/transformation/file/index.js @@ -535,7 +535,9 @@ export default class File { result.code = `${this.shebang}\n${result.code}`; } - result.map = this.mergeSourceMap(result.map); + if (result.map) { + result.map = this.mergeSourceMap(result.map); + } if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { result.code += "\n" + convertSourceMap.fromObject(result.map).toComment();