From e89d52ccbf2e3dfc9a9fc1dd8b817669f7d077bf Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 31 Aug 2017 16:46:39 +0100 Subject: [PATCH] Do not get avatars when no groups were/could be retrieved --- src/components/views/elements/Flair.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index cfabd4841e..9b0534e9b0 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -148,6 +148,9 @@ export default class Flair extends React.Component { } catch (err) { console.error('Could not get groups for user', this.props.userId, err); } + if (!groups || groups.length === 0) { + return; + } const avatarUrls = await this._getAvatarUrls(groups); if (!this.unmounted) { this.setState({avatarUrls});