diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-08-21 19:41:39 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:02:05 +0300 |
commit | 3738fe92f469a9722c72784e48f5a9dc037d5772 (patch) | |
tree | 4542aebb1e9bd3b79c0d9d4e23a166dc3ab77925 /routing | |
parent | 6437de93eec093a40624c06f54fe630cdeaee3c9 (diff) |
[sounds] No sounds file crash fix.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/turns_tts_text.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/routing/turns_tts_text.cpp b/routing/turns_tts_text.cpp index 1105c36574..e55ed3f47a 100644 --- a/routing/turns_tts_text.cpp +++ b/routing/turns_tts_text.cpp @@ -36,7 +36,8 @@ void GetTtsText::SetLocale(string const & locale) { m_locale = locale; m_getCurLang.reset(new platform::GetTextById(platform::TextSource::TtsSound, locale)); - ASSERT(m_getCurLang && m_getCurLang->IsValid(), ()); + /// @todo Factor out file check from constructor and do not create m_getCurLang object in case of error. + ASSERT(m_getCurLang, ()); } void GetTtsText::SetLocaleWithJson(string const & jsonBuffer) @@ -47,6 +48,8 @@ void GetTtsText::SetLocaleWithJson(string const & jsonBuffer) string GetTtsText::operator()(Notification const & notification) const { + if (!m_getCurLang->IsValid()) + return string(); if (notification.m_distanceUnits == 0 && !notification.m_useThenInsteadOfDistance) return GetTextById(GetDirectionTextId(notification)); |