Chess: Fix crash if call get_figurine_id("")
This commit is contained in:
parent
1156940f99
commit
0ef5c3eee7
@ -1089,7 +1089,11 @@ end
|
|||||||
|
|
||||||
local function get_figurine_id(piece_itemname)
|
local function get_figurine_id(piece_itemname)
|
||||||
local piece_s = piece_itemname:match(":(%w+_%w+)")
|
local piece_s = piece_itemname:match(":(%w+_%w+)")
|
||||||
return figurines_str:match("(%d+)=chess_figurine_" .. piece_s)
|
if not piece_s then
|
||||||
|
return MOVES_LIST_SYMBOL_EMPTY
|
||||||
|
else
|
||||||
|
return figurines_str:match("(%d+)=chess_figurine_" .. piece_s)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user