From 47b7b86071d92b9074c504075cd25f563bc9d46b Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 1 Jun 2018 14:11:15 -0700 Subject: Validate existence of files used in TtsChunks --- .../src/commands/mobile/alert_maneuver_request.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc') diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index d5767690d7..dee364cb99 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -92,6 +92,21 @@ void AlertManeuverRequest::Run() { // check TTSChunk parameter if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) { + smart_objects::SmartObject& tts_chunks = + (*message_)[strings::msg_params][strings::tts_chunks]; + mobile_apis::Result::eType verification_result = + MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); + + if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { + LOG4CXX_ERROR(logger_, + "MessageHelper::VerifyTtsFiles return " + << verification_result); + SendResponse(false, + mobile_apis::Result::FILE_NOT_FOUND, + "One or more files needed for tts_chunks are not present"); + return; + } + if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) { pending_requests_.Add(hmi_apis::FunctionID::TTS_Speak); tts_is_ok = true; -- cgit v1.2.1