Avoid for pairs error

This commit is contained in:
Applevangelist 2024-01-19 19:06:52 +01:00
parent 08f2c29014
commit 581138b5bc

View File

@ -1204,7 +1204,7 @@ do
if not DontSetCargoBayLimit then
-- I set the default cargo bay weight limit each time a new group is added to the set.
-- TODO Why is this here in the first place?
for UnitID, UnitData in pairs( group:GetUnits() ) do
for UnitID, UnitData in pairs( group:GetUnits() or {} ) do
if UnitData and UnitData:IsAlive() then
UnitData:SetCargoBayWeightLimit()
end