Changed how translations are found to avoid crash with broken lbl files

This commit is contained in:
Anton Arbring
2015-06-21 20:05:25 -04:00
parent 083f2948e9
commit e5d6bef5c9

View File

@@ -101,8 +101,7 @@ std::string LabelParser::decode(std::string line){
for (auto key : _fileTranslation){
std::size_t value = line.find(key.first);
if (value != std::string::npos){
std::string toTranslate = line.substr(value);
return _fileTranslation[toTranslate]->getTranslation()[0]; //lbls always 1:1 -> single value return.
return _fileTranslation[key.first]->getTranslation()[0]; //lbls always 1:1 -> single value return.
}
}
return "";