diff --git a/jscore.cpp b/jscore.cpp index bb9e7cd..c16a494 100644 --- a/jscore.cpp +++ b/jscore.cpp @@ -126,9 +126,11 @@ namespace jscore { return score.size(); } string getUserName(const int index) { + if (score.size()==0 || index >= score.size()) return ""; return score[index].name; } const int getPoints(const int index) { + if (score.size()==0 || index >= score.size()) return 0; return score[index].points; }