Merge pull request #2237 from shaji-Dev/master

[FIXED] attempt to index a nil value
This commit is contained in:
Thomas 2025-01-31 10:04:01 +01:00 committed by GitHub
commit 8e286edd25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -757,7 +757,11 @@ end
-- @param #GROUP self -- @param #GROUP self
-- @return #boolean If true, group is associated with a client or player slot. -- @return #boolean If true, group is associated with a client or player slot.
function GROUP:IsPlayer() function GROUP:IsPlayer()
return self:GetUnit(1):IsPlayer() local unit = self:GetUnit(1)
if unit then
return unit:IsPlayer()
end
return false
end end
--- Returns the UNIT wrapper object with number UnitNumber. If it doesn't exist, tries to return the next available unit. --- Returns the UNIT wrapper object with number UnitNumber. If it doesn't exist, tries to return the next available unit.