Skip to content

Commit 4dcd097

Browse files
lukeapageoliviertassinari
authored andcommitted
Protect against unhandled exception. Fixes #169 (#171)
1 parent ef9b3d2 commit 4dcd097

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function memberExpressionRootIdentifier(path) {
7878
memberExpression = parent.get('value')
7979
}
8080

81-
if (!memberExpression) {
81+
if (!memberExpression || memberExpression.type !== 'MemberExpression') {
8282
// This case is currently unhandled by this plugin.
8383
return null
8484
}

test/fixtures/bugfix-169/actual.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test extends React.Component {
2+
static propTypes = {
3+
columns: PropTypes.shape({
4+
[constants.TEST]: STRING_PROP_TYPE,
5+
}),
6+
};
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class Test extends React.Component {}

0 commit comments

Comments
 (0)