diff --git a/shop.lua b/shop.lua
index 1ee4438985440790d40c84133c6861c69ff57dca..531302fe1d7f91de58674958c675f9958c954fac 100644
--- a/shop.lua
+++ b/shop.lua
@@ -91,6 +91,7 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
 		return
 	end
 	local player_name = sender:get_player_name()
+	if not exchange_shop[player_name] then return end
 	local pos = exchange_shop[player_name]
 	local meta = minetest.get_meta(pos)
 	local title = meta:get_string("title") or ""
@@ -339,4 +340,4 @@ minetest.register_craft({
 		{"default:sign_wall"},
 		{"default:chest_locked"},
 	}
-})
\ No newline at end of file
+})