mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user