Fix crash when writing a card with no description

master
cheapie 2020-03-28 01:43:12 -05:00
parent 77b4fbe12d
commit 3c7e4a4f82
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ minetest.register_node("digistuff:card_reader",{
meta:set_int("writepending",1)
if type(msg.data) ~= "string" then msg.data = tostring(msg.data) end
meta:set_string("writedata",string.sub(msg.data,1,256))
if type(msg.description == "string") then
if type(msg.description) == "string" then
meta:set_string("writedescription",string.sub(msg.description,1,64))
else
meta:set_string("writedescription","no name")