summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 12:42:20 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 13:53:09 +0200
commit7f76bb48b352984c4de8f40509618763e39f181f (patch)
tree051d788b3dd466bbc560de3dc96d271c9f768343 /rbutil/rbutilqt/installtalkwindow.cpp
parenta2dd1625bcfb1272cb711dc35896924817af3c0c (diff)
downloadrockbox-7f76bb48b352984c4de8f40509618763e39f181f.tar.gz
rockbox-7f76bb48b352984c4de8f40509618763e39f181f.tar.bz2
rockbox-7f76bb48b352984c4de8f40509618763e39f181f.zip
Don't assume success for TTS object creation.
While the current implementation of getTTS() will always return an object this might change later. Check the returned object before using it to be on the safe side. Change-Id: Ic949cae7cfbe6f3086dee6aab741b0acafe14640
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index 95aad659ed..9a723261b8 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -130,6 +130,12 @@ void InstallTalkWindow::updateSettings(void)
QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
QString ttsName = RbSettings::value(RbSettings::Tts).toString();
TTSBase* tts = TTSBase::getTTS(this,ttsName);
+ if(!tts)
+ {
+ QMessageBox::critical(this, tr("TTS error"),
+ tr("The selected TTS failed to initialize. You can't use this TTS."));
+ return;
+ }
if(tts->configOk())
ui.labelTtsProfile->setText(QString("<b>%1</b>")
.arg(TTSBase::getTTSName(ttsName)));