Skip to content

Commit 6260a3c

Browse files
authored
Merge pull request #39 from avishayil/eslint-style
- Fixed when there is no name and no string
2 parents 6ef290a + 7ce1d3c commit 6260a3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class UserAvatar extends React.PureComponent {
5050
borderRadius,
5151
style,
5252
} = this.props;
53-
if (!name) throw new Error('Avatar requires a name');
53+
if (!name && !src) throw new Error('Avatar requires a name or source');
5454
if (typeof size !== 'number') size = parseInt(size);
5555
let abbr = initials(name);
5656
if (name.startsWith('+')) {

0 commit comments

Comments
 (0)