fix NPE when getGroupProfiles returns null

pull/21833/head
Matthew Hodgson 2018-01-19 10:39:38 +00:00
parent c090c2e7df
commit 6c15bd8599
1 changed files with 5 additions and 1 deletions

View File

@ -107,7 +107,11 @@ export default class Flair extends React.Component {
} }
const profiles = await this._getGroupProfiles(groups); const profiles = await this._getGroupProfiles(groups);
if (!this.unmounted) { if (!this.unmounted) {
this.setState({profiles: profiles.filter((profile) => {return profile.avatarUrl;})}); this.setState({
profiles: profiles.filter((profile) => {
return profile ? profile.avatarUrl : false;
})
});
} }
} }