summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-12 20:10:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-12 20:10:18 +0300
commit505ae2088405e69a9ed2fbf38ef8a7da08a33779 (patch)
tree488a17e5a881e4c40ec911a53d8017f19c05ee7f
parentdc452b6d1908eced3388aa0284eac34ef65510ff (diff)
downloadmanaverse-505ae2088405e69a9ed2fbf38ef8a7da08a33779.tar.gz
manaverse-505ae2088405e69a9ed2fbf38ef8a7da08a33779.tar.bz2
manaverse-505ae2088405e69a9ed2fbf38ef8a7da08a33779.tar.xz
manaverse-505ae2088405e69a9ed2fbf38ef8a7da08a33779.zip
Fix wrong image loading in LangListModel.
-rw-r--r--src/gui/models/langlistmodel.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/models/langlistmodel.h b/src/gui/models/langlistmodel.h
index 1adfb3e91..054af17ad 100644
--- a/src/gui/models/langlistmodel.h
+++ b/src/gui/models/langlistmodel.h
@@ -92,8 +92,16 @@ class LangListModel final : public ExtendedListModel
{
for (int f = 0; f < langs_count; f ++)
{
- mIcons[f] = resourceManager->getImage("graphics/flags/"
- + LANG_NAME[f].icon);
+ const std::string icon = LANG_NAME[f].icon;
+ if (!icon.empty())
+ {
+ mIcons[f] = resourceManager->getImage("graphics/flags/"
+ + icon);
+ }
+ else
+ {
+ mIcons[f] = nullptr;
+ }
}
}