summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-19 01:25:36 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-19 01:25:36 +0300
commit22dad6067a9eaa7f88273cca02d123cadfcb5073 (patch)
tree1fb5b4f4ccc4df6cb5f8ecc2fe6b123ebfab7c71
parent49df4c95b77d228dbdb4e42d65829cbf56b670bf (diff)
downloadplus-22dad6067a9eaa7f88273cca02d123cadfcb5073.tar.gz
plus-22dad6067a9eaa7f88273cca02d123cadfcb5073.tar.bz2
plus-22dad6067a9eaa7f88273cca02d123cadfcb5073.tar.xz
plus-22dad6067a9eaa7f88273cca02d123cadfcb5073.zip
Add missing check to skilldialog.
-rw-r--r--src/gui/skilldialog.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 063e29939..1d0c12001 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -67,7 +67,11 @@ class SkillModel final : public gcn::ListModel
{ return static_cast<int>(mVisibleSkills.size()); }
SkillInfo *getSkillAt(const int i) const
- { return mVisibleSkills.at(i); }
+ {
+ if (i < 0 || i >= static_cast<int>(mVisibleSkills.size()))
+ return nullptr;
+ return mVisibleSkills.at(i);
+ }
std::string getElementAt(int i)
{