(51d0e9a7a) Fixed crashing when firing a revolver in the sub editor. Closes #1631

This commit is contained in:
Joonas Rikkonen
2019-06-14 12:22:55 +03:00
parent 34d0d1e9f8
commit 1130eef310
2 changed files with 9 additions and 1 deletions
@@ -275,7 +275,14 @@ namespace Barotrauma.Items.Components
//the raycast didn't hit anything -> the projectile flew somewhere outside the level and is permanently lost
if (!hitSomething)
{
Entity.Spawner.AddToRemoveQueue(item);
if (Entity.Spawner == null)
{
item.Remove();
}
else
{
Entity.Spawner.AddToRemoveQueue(item);
}
}
}