diff --git a/Content.Server/Administration/AGhost.cs b/Content.Server/Administration/AGhost.cs index dfe516576b..5226c4637f 100644 --- a/Content.Server/Administration/AGhost.cs +++ b/Content.Server/Administration/AGhost.cs @@ -22,6 +22,12 @@ namespace Content.Server.Administration } var mind = player.ContentData().Mind; + if (mind == null) + { + shell.SendText(player, "You can't ghost here!"); + return; + } + if (mind.VisitingEntity != null && mind.VisitingEntity.Prototype.ID == "AdminObserver") { var visiting = mind.VisitingEntity; diff --git a/Content.Server/Observer/Ghost.cs b/Content.Server/Observer/Ghost.cs index 6c71882c9e..e1ea953bd6 100644 --- a/Content.Server/Observer/Ghost.cs +++ b/Content.Server/Observer/Ghost.cs @@ -28,6 +28,12 @@ namespace Content.Server.Observer } var mind = player.ContentData().Mind; + if (mind == null) + { + shell.SendText(player, "You can't ghost here!"); + return; + } + var canReturn = player.AttachedEntity != null && CanReturn; var name = player.AttachedEntity?.Name ?? player.Name;