Handle the case where a map hasn't been rated yet

This commit is contained in:
Dean Herbert 2017-11-23 23:30:57 +09:00
parent 2bd425d64f
commit dbb03bcff2

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.Select.Details
negativeRatings.Text = negativeCount.ToString();
positiveRatings.Text = (totalCount - negativeCount).ToString();
ratingsBar.Length = (float)negativeCount / totalCount;
ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r);
}
}