From 5aa411b58c25aae2e8b49f49a3c5c3731fb03969 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 24 Jul 2014 11:31:08 -0400 Subject: [PATCH] FIX: When we don't have an `uploaded_avatar_id` don't try to show the avatar. Wait until it's loaded. --- .../discourse/controllers/poster-expansion.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/poster-expansion.js.es6 b/app/assets/javascripts/discourse/controllers/poster-expansion.js.es6 index 5130d1a9b82..c4b969defad 100644 --- a/app/assets/javascripts/discourse/controllers/poster-expansion.js.es6 +++ b/app/assets/javascripts/discourse/controllers/poster-expansion.js.es6 @@ -34,7 +34,11 @@ export default Discourse.ObjectController.extend({ var currentUsername = this.get('username'), wasVisible = this.get('visible'); - this.set('avatar', {username: username, uploaded_avatar_id: uploadedAvatarId}); + if (uploadedAvatarId) { + this.set('avatar', {username: username, uploaded_avatar_id: uploadedAvatarId}); + } else { + this.set('avatar', null); + } this.setProperties({visible: true, username: username});