Skip to content

Commit

Permalink
Ensure all falsy values for file are addressed (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
johno authored and wooorm committed Dec 17, 2020
1 parent 92ee312 commit ba6cdfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mdx/mdx-hast-to-jsx.js
Expand Up @@ -251,8 +251,8 @@ function toTemplateLiteral(value) {
}

function compile(options = {}) {
function compiler(tree, file = {}) {
return toJSX(tree, undefined, {filename: file.path, ...options})
function compiler(tree, file) {
return toJSX(tree, undefined, {filename: (file || {}).path, ...options})
}

this.Compiler = compiler
Expand Down

0 comments on commit ba6cdfd

Please sign in to comment.