Skip to content

Commit

Permalink
Add logging to SharedStorageSystem prototype indexing failure (#29273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tayrtahn committed Jun 21, 2024
1 parent 831d962 commit 0b34592
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,12 @@ public ItemSizePrototype GetMaxItemSize(Entity<StorageComponent?> uid)

// If we specify a max item size, use that
if (uid.Comp.MaxItemSize != null)
return _prototype.Index(uid.Comp.MaxItemSize.Value);
{
if (_prototype.TryIndex(uid.Comp.MaxItemSize.Value, out var proto))
return proto;

Log.Error($"{ToPrettyString(uid.Owner)} tried to get invalid item size prototype: {uid.Comp.MaxItemSize.Value}. Stack trace:\\n{Environment.StackTrace}");
}

if (!_itemQuery.TryGetComponent(uid, out var item))
return _defaultStorageMaxItemSize;
Expand Down

0 comments on commit 0b34592

Please sign in to comment.