From 6c15bd859987b1d7698f55777fa90d0574e9ac04 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 19 Jan 2018 10:39:38 +0000 Subject: [PATCH] fix NPE when getGroupProfiles returns null --- src/components/views/elements/Flair.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index a487395a87..009817a340 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -107,7 +107,11 @@ export default class Flair extends React.Component { } const profiles = await this._getGroupProfiles(groups); if (!this.unmounted) { - this.setState({profiles: profiles.filter((profile) => {return profile.avatarUrl;})}); + this.setState({ + profiles: profiles.filter((profile) => { + return profile ? profile.avatarUrl : false; + }) + }); } }