From 822b41b853d16d735e86172d3d0b6bc762e91423 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Wed, 26 Jun 2024 16:08:21 -0300 Subject: [PATCH] fix: gamestore nil player --- data/modules/scripts/gamestore/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/modules/scripts/gamestore/init.lua b/data/modules/scripts/gamestore/init.lua index 214aec77d43..322a7749c93 100644 --- a/data/modules/scripts/gamestore/init.lua +++ b/data/modules/scripts/gamestore/init.lua @@ -540,6 +540,11 @@ end -- Both functions use same formula! function parseOpenTransactionHistory(playerId, msg) + local player = Player(playerId) + if not player then + return + end + local page = 1 GameStore.DefaultValues.DEFAULT_VALUE_ENTRIES_PER_PAGE = msg:getByte() sendStoreTransactionHistory(playerId, page, GameStore.DefaultValues.DEFAULT_VALUE_ENTRIES_PER_PAGE) @@ -547,6 +552,11 @@ function parseOpenTransactionHistory(playerId, msg) end function parseRequestTransactionHistory(playerId, msg) + local player = Player(playerId) + if not player then + return + end + local page = msg:getU32() sendStoreTransactionHistory(playerId, page + 1, GameStore.DefaultValues.DEFAULT_VALUE_ENTRIES_PER_PAGE) player:updateUIExhausted()