From 152b860a235888fe7ad8c4a977f24950957366df Mon Sep 17 00:00:00 2001 From: Scott Erickson <sderickson@gmail.com> Date: Thu, 12 Jun 2014 14:44:55 -0700 Subject: [PATCH] Hotfix for the profile view. --- app/views/account/profile_view.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/account/profile_view.coffee b/app/views/account/profile_view.coffee index 0c2c95b17..ef49b583c 100644 --- a/app/views/account/profile_view.coffee +++ b/app/views/account/profile_view.coffee @@ -224,8 +224,11 @@ module.exports = class ProfileView extends View links = ($.extend(true, {}, link) for link in links) link.icon = @iconForLink link for link in links context.profileLinks = _.sortBy links, (link) -> not link.icon # icons first - context.sessions = (s.attributes for s in @sessions.models when (s.get('submitted') or s.get('level-id') is 'gridmancer')) - context.sessions.sort (a, b) -> (b.playtime ? 0) - (a.playtime ? 0) + if @sessions + context.sessions = (s.attributes for s in @sessions.models when (s.get('submitted') or s.get('level-id') is 'gridmancer')) + context.sessions.sort (a, b) -> (b.playtime ? 0) - (a.playtime ? 0) + else + context.sessions = [] context afterRender: ->