Chess: Fix crash if call get_figurine_id("")

This commit is contained in:
Wuzzy 2024-09-19 14:03:07 +02:00
parent 1156940f99
commit 0ef5c3eee7

View File

@ -1089,7 +1089,11 @@ end
local function get_figurine_id(piece_itemname)
local piece_s = piece_itemname:match(":(%w+_%w+)")
if not piece_s then
return MOVES_LIST_SYMBOL_EMPTY
else
return figurines_str:match("(%d+)=chess_figurine_" .. piece_s)
end
end