summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-02 12:49:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-02 12:49:03 +0300
commit421c0d17d65ee740c992c96b04a00b846b50a2e5 (patch)
treedbc4b398940d5054fcb9680f3076c28c3c8ba565 /src/gui/widgets
parent25b140643566c251d89cc83261b90171b768abbe (diff)
downloadmanaverse-421c0d17d65ee740c992c96b04a00b846b50a2e5.tar.gz
manaverse-421c0d17d65ee740c992c96b04a00b846b50a2e5.tar.bz2
manaverse-421c0d17d65ee740c992c96b04a00b846b50a2e5.tar.xz
manaverse-421c0d17d65ee740c992c96b04a00b846b50a2e5.zip
Fix crash in tests without translator created.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/browserbox.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 37abf7d0a..1657968df 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -251,14 +251,11 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
{
const int id = atoi(bLink.link.c_str());
if (id)
- {
- bLink.caption = translator->getStr(
- ItemDB::get(id).getName());
- }
+ bLink.caption = ItemDB::get(id).getName();
else
- {
- bLink.caption = translator->getStr(bLink.link);
- }
+ bLink.caption = bLink.link;
+ if (translator)
+ bLink.caption = translator->getStr(bLink.caption);
}
newRow.append(tmp.substr(0, idx1));