summaryrefslogtreecommitdiff
path: root/src/gui/skilldialog.cpp
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 /src/gui/skilldialog.cpp
parent49df4c95b77d228dbdb4e42d65829cbf56b670bf (diff)
downloadmv-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.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)
{