From 3b7a4644d58ac0bbd68cc708e921ba36c8e2bee2 Mon Sep 17 00:00:00 2001 From: 1F616EMO~nya Date: Wed, 1 May 2024 18:56:18 +0800 Subject: [PATCH] Fix nil --- mods/rp_color_pick/init.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/rp_color_pick/init.lua b/mods/rp_color_pick/init.lua index 5a60de6..84ba2d9 100644 --- a/mods/rp_color_pick/init.lua +++ b/mods/rp_color_pick/init.lua @@ -67,6 +67,8 @@ end) minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() - cooldowns[name]:cancel() - cooldowns[name] = nil -end) \ No newline at end of file + if cooldowns[name] then + cooldowns[name]:cancel() + cooldowns[name] = nil + end +end)