From d14a5e59661de0b704d640660a0978f2ec3ce4dc Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Wed, 7 May 2025 18:46:05 +0200 Subject: [PATCH] Fixed rare error when entity data is not a table --- features/eid_api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/eid_api.lua b/features/eid_api.lua index 8cb3ebf7..51a478c3 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -2114,7 +2114,7 @@ end ---@param entity Entity ---@return any? function EID:getEntityData(entity, str) - if EID:EntitySanityCheck(entity) and not EID:IsGridEntity(entity) and entity:GetData() ~= nil then + if EID:EntitySanityCheck(entity) and not EID:IsGridEntity(entity) and entity:GetData() ~= nil and type(entity:GetData()) == "table" then return entity:GetData()[str] end return nil @@ -2124,7 +2124,7 @@ end ---@param str string ---@param value any function EID:setEntityData(entity, str, value) - if EID:EntitySanityCheck(entity) and not EID:IsGridEntity(entity) and entity:GetData() ~= nil then + if EID:EntitySanityCheck(entity) and not EID:IsGridEntity(entity) and entity:GetData() ~= nil and type(entity:GetData()) == "table" then entity:GetData()[str] = value end end