Fixed railgun HUD crash when the first linked item doesn't have an ItemContainer
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@ bld/
|
||||
#performance reports & sessions
|
||||
*.vsp
|
||||
*.psess
|
||||
.vs/
|
||||
|
||||
@@ -347,6 +347,9 @@ namespace Barotrauma.Items.Components
|
||||
if (returnNull)
|
||||
{
|
||||
var itemContainer = projectileContainer.GetComponent<ItemContainer>();
|
||||
if (itemContainer == null) continue;
|
||||
if (itemContainer.Inventory == null) continue;
|
||||
if (itemContainer.Inventory.Items == null) continue;
|
||||
for (int i = 0; i < itemContainer.Inventory.Items.Length; i++)
|
||||
{
|
||||
projectiles.Add(itemContainer.Inventory.Items[i]?.GetComponent<Projectile>());
|
||||
|
||||
Reference in New Issue
Block a user