Skip to content

Commit

Permalink
fix(babel-plugin-react-intl): fix babel crash with `removeDefaultMess…
Browse files Browse the repository at this point in the history
…age` (#2306)

fix #2305
  • Loading branch information
IcanDivideBy0 committed Nov 12, 2020
1 parent d2934cf commit 847bee8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/babel-plugin-react-intl/index.ts
Expand Up @@ -536,10 +536,6 @@ export default declare((api: any, options: OptionsSchema) => {
descriptionAttr.remove();
}

if (removeDefaultMessage && defaultMessageAttr) {
defaultMessageAttr.remove();
}

if (
!removeDefaultMessage &&
ast &&
Expand Down Expand Up @@ -571,6 +567,10 @@ export default declare((api: any, options: OptionsSchema) => {
}
}

if (removeDefaultMessage && defaultMessageAttr) {
defaultMessageAttr.remove();
}

// Tag the AST node so we don't try to extract it twice.
tagAsExtracted(path);
}
Expand Down

0 comments on commit 847bee8

Please sign in to comment.