From bd1261802d0766fe1822d7eb52023f8fa3718caa Mon Sep 17 00:00:00 2001
From: Michael Schmatz <michaelschmatz@gmail.com>
Date: Fri, 16 May 2014 13:27:42 -0700
Subject: [PATCH] Fix rank for unranked sessions on ladder histogram

---
 app/views/play/ladder/ladder_tab.coffee | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/views/play/ladder/ladder_tab.coffee b/app/views/play/ladder/ladder_tab.coffee
index c1213e541..6e12172d3 100644
--- a/app/views/play/ladder/ladder_tab.coffee
+++ b/app/views/play/ladder/ladder_tab.coffee
@@ -242,7 +242,8 @@ module.exports = class LadderTabView extends CocoView
     if teamName.toLowerCase() is "humans" then rankClass = "rank-text humans-rank-text"
 
     message = "#{histogramData.length} players"
-    if @leaderboards[teamName].session? then message="##{@leaderboards[teamName].myRank} of #{histogramData.length}"
+    if @leaderboards[teamName].session? and @leaderboards[teamName].myRank <= histogramData.length
+      message="##{@leaderboards[teamName].myRank} of #{histogramData.length}"
     svg.append("g")
       .append("text")
       .attr("class",rankClass)