]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add logging to SharedStorageSystem prototype indexing failure (#29273)
authorTayrtahn <tayrtahn@gmail.com>
Fri, 21 Jun 2024 00:16:43 +0000 (20:16 -0400)
committerGitHub <noreply@github.com>
Fri, 21 Jun 2024 00:16:43 +0000 (10:16 +1000)
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs

index f20e2f9ab1f2cd077f5949586be75d04f364ceb4..2b434befe5399c408e1a5f051711367dfbec3852 100644 (file)
@@ -1384,7 +1384,12 @@ public abstract class SharedStorageSystem : EntitySystem
 
         // 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;