Fix potential "image is nil" error in [message]
This commit is contained in:
parent
d3374d3670
commit
a275f22ebe
1 changed files with 4 additions and 4 deletions
|
@ -24,6 +24,10 @@ local function get_image(cfg, speaker)
|
|||
image = speaker.portrait
|
||||
end
|
||||
|
||||
if image == "none" or image == nil then
|
||||
return "", true
|
||||
end
|
||||
|
||||
if image:find("~RIGHT%(%)") then
|
||||
left_side = false
|
||||
-- The percent signs escape the parentheses for a literal match
|
||||
|
@ -38,10 +42,6 @@ local function get_image(cfg, speaker)
|
|||
image = image:gsub("~LEFT%(%)", "")
|
||||
end
|
||||
|
||||
if image == "none" or image == nil then
|
||||
return "", true
|
||||
end
|
||||
|
||||
return image, left_side
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue