Fixed crash when pressing BACK in lobby (#46)

* Fixed crash when pressing BACK in lobby

* that's true
This commit is contained in:
DamianX
2018-03-24 16:54:13 +01:00
committed by Pieter-Jan Briers
parent bddd31b1b0
commit 63b5d83728

View File

@@ -55,13 +55,13 @@ namespace Content.Client.UserInterface
protected override void DrawContents()
{
if (_playerManager?.LocalPlayer.ControlledEntity == null)
if (_playerManager?.LocalPlayer == null)
{
return;
}
IEntity entity = _playerManager.LocalPlayer.ControlledEntity;
if (!entity.TryGetComponent<IHandsComponent>(out var hands))
if (entity == null || !entity.TryGetComponent<IHandsComponent>(out var hands))
{
return;
}