Skip to content

Commit 49b9af6

Browse files
committed
Add checks and balances
1 parent 357396c commit 49b9af6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

index.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ function babelPluginTransformReactEs6ClassDisplayName (babel) {
1212

1313
function addDisplayName (t) {
1414
if (
15-
this.node.superClass.name === 'Component' ||
15+
this.node.superClass &&
1616
(
17-
this.node.superClass.object &&
18-
this.node.superClass.object.name === 'React' &&
19-
this.node.superClass.property.name === 'Component'
17+
this.node.superClass.name === 'Component' ||
18+
(
19+
this.node.superClass.object &&
20+
this.node.superClass.object.name === 'React' &&
21+
this.node.superClass.property.name === 'Component'
22+
)
2023
)
2124
) {
2225
this.insertAfter([

0 commit comments

Comments
 (0)