From 421c0d17d65ee740c992c96b04a00b846b50a2e5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 Mar 2015 12:49:03 +0300 Subject: Fix crash in tests without translator created. --- src/gui/widgets/browserbox.cpp | 11 ++++------- 1 file 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)); -- cgit v1.2.3-60-g2f50