summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/createvoicewindow.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/createvoicewindow.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/createvoicewindow.cpp')
-rw-r--r--rbutil/rbutilqt/createvoicewindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/createvoicewindow.cpp b/rbutil/rbutilqt/createvoicewindow.cpp
index 8bd4e8d693..5b6ef16699 100644
--- a/rbutil/rbutilqt/createvoicewindow.cpp
+++ b/rbutil/rbutilqt/createvoicewindow.cpp
@@ -93,6 +93,12 @@ void CreateVoiceWindow::updateSettings(void)
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(tr("Engine: <b>%1</b>")
.arg(TTSBase::getTTSName(ttsName)));