From 959555bb5b37dc3923ee5384c500da6df0c8f124 Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Sat, 31 Oct 2015 10:43:05 +0000 Subject: [PATCH] Fix for null steam ids --- lib/react/user.jsx | 6 +++--- lib/user/user.js | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/react/user.jsx b/lib/react/user.jsx index 9641cec..1b0dd08 100644 --- a/lib/react/user.jsx +++ b/lib/react/user.jsx @@ -136,9 +136,9 @@ var UserItem = React.createClass({ let user = this.props.user; return (
  • - {user.username} - + {user.username} +
  • ); } diff --git a/lib/user/user.js b/lib/user/user.js index 9f1a912..6025f39 100644 --- a/lib/user/user.js +++ b/lib/user/user.js @@ -24,11 +24,19 @@ function User (user) { this.moderator = user['moderator']; this.team = user['team']; this.bans = user['bans']; - this.steam = { - id: user['steam']['id'] || null, - url: user['steam']['url'] || null, - nickname: user['steam']['nickname'] || null - }; + if (user['steam']) { + this.steam = { + id: user['steam']['id'] || null, + url: user['steam']['url'] || null, + nickname: user['steam']['nickname'] || null + }; + } else { + this.steam = { + id: null, + url: null, + nickname: null + }; + } this.profile = null; this.hive = { id: null