Добавлена проверка на валидность EntityUid в DontSellingGridSystems для предотвращения обработки недействительных объектов.

This commit is contained in:
Vigers Ray 2026-01-24 00:49:52 +01:00
parent 103e1c73ad
commit 72c4842213

View file

@ -72,6 +72,9 @@ public sealed class StationDontSellingSystems : EntitySystem
private void DepreciatePrice(EntityUid uid)
{
if (!uid.IsValid())
return;
EnsureComp<DontSellComponent>(uid);
if (!_containerQuery.TryComp(uid, out var containers))
@ -81,7 +84,8 @@ public sealed class StationDontSellingSystems : EntitySystem
{
foreach (var ent in container.ContainedEntities)
{
DepreciatePrice(ent);
if (ent.IsValid())
DepreciatePrice(ent);
}
}
}