Fix NPE with few songs in category

This commit is contained in:
Flamefire committed 2014-08-09 15:27:05 +02:00
1 parent 09d36ccf60
commit ced12ac064
4 files changed
+38 -37

No files matched your search

+1 -1
View File
@@ -284,7 +284,7 @@ namespace Vocaluxe.Screens
else
{
_Pos += num;
_Pos = _Pos.Clamp(0, _Scores[_Round].Count - 1);
_Pos = _Pos.Clamp(0, _Scores[_Round].Count - 1, true);
}
}
-4
View File
@@ -396,12 +396,8 @@ namespace Vocaluxe.Screens
private void _ChangeRound(int num)
{
if (_Points.NumRounds < 1)
return;
_Round += num;
_Round = _Round.Clamp(-1, _Points.NumRounds - 1);
if (_Round >= _Points.NumRounds)
_Round = _Points.NumRounds - 1;
_UpdateRatings();
}