diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-19 01:25:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-19 01:25:36 +0300 |
commit | 22dad6067a9eaa7f88273cca02d123cadfcb5073 (patch) | |
tree | 1fb5b4f4ccc4df6cb5f8ecc2fe6b123ebfab7c71 /src/gui/skilldialog.cpp | |
parent | 49df4c95b77d228dbdb4e42d65829cbf56b670bf (diff) | |
download | mv-22dad6067a9eaa7f88273cca02d123cadfcb5073.tar.gz mv-22dad6067a9eaa7f88273cca02d123cadfcb5073.tar.bz2 mv-22dad6067a9eaa7f88273cca02d123cadfcb5073.tar.xz mv-22dad6067a9eaa7f88273cca02d123cadfcb5073.zip |
Add missing check to skilldialog.
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 6 |
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) { |