(d8eff8346) Fix a null reference exception.

This commit is contained in:
Joonas Rikkonen
2019-04-29 21:10:35 +03:00
parent d3ef770243
commit 6c4bf4ea44
2 changed files with 1 additions and 84 deletions
@@ -1069,7 +1069,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);