Fix crash if /home executed in irc, discord, etc

Running /home by any player in remote chat utilities(for example IRC, discordmt) was crashing the server if the player with the same name is not on the server
This commit is contained in:
Zemtzov7 2022-11-20 00:18:02 +05:00 committed by GitHub
parent 99a7193095
commit 26ca869cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,9 @@ end
sethome.get = function(name)
local player = minetest.get_player_by_name(name)
if not player then
return nil
end
local player_meta = player:get_meta()
local pos = minetest.string_to_pos(player_meta:get_string("sethome:home"))
if pos then