(83ad1f3d2) Fix a null reference exception.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:16:31 +03:00
parent 5b3696f7e4
commit 6bdd0ab8c0
9 changed files with 300 additions and 53 deletions
@@ -1067,7 +1067,7 @@ namespace Barotrauma
var wall = SelectedAiTarget.Entity as Structure;
if (wall == null)
{
wall = wallTarget.Structure;
wall = wallTarget?.Structure;
}
// The target is not a wall or it's not the same as we are attached to -> release
bool releaseTarget = wall == null || !wall.Bodies.Contains(LatchOntoAI.AttachJoints[0].BodyB);