Added check if transcription result is nil (#3724)
If the message is too short then the result is nil. Error occurs in this case: record_message.lua:97: attempt to index field 'results' (a nil value) Added check if transcribe_json["results"] is nil.
This commit is contained in:
parent
ed48f3aba5
commit
c4962c460e
|
|
@ -81,6 +81,11 @@
|
|||
return ''
|
||||
end
|
||||
local transcribe_json = JSON.decode(transcribe_result);
|
||||
--Trancribe result can be nil
|
||||
if (transcribe_json["results"] == nil) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: results = (null) \n");
|
||||
return ''
|
||||
end
|
||||
if (debug["info"]) then
|
||||
if (transcribe_json["results"][1]["name"] == nil) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: (null) \n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue