- Si no hi ha usuaris, o si se demana un index mes alt que el nombre de usuaris, ja no peta.
This commit is contained in:
@@ -126,9 +126,11 @@ namespace jscore {
|
|||||||
return score.size();
|
return score.size();
|
||||||
}
|
}
|
||||||
string getUserName(const int index) {
|
string getUserName(const int index) {
|
||||||
|
if (score.size()==0 || index >= score.size()) return "";
|
||||||
return score[index].name;
|
return score[index].name;
|
||||||
}
|
}
|
||||||
const int getPoints(const int index) {
|
const int getPoints(const int index) {
|
||||||
|
if (score.size()==0 || index >= score.size()) return 0;
|
||||||
return score[index].points;
|
return score[index].points;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user