Medical Scanner check session active (#6197)

This commit is contained in:
Morbo
2022-01-16 23:10:48 +03:00
committed by GitHub
parent 958d82e9d6
commit 4c5c934f8e

View File

@@ -213,15 +213,14 @@ namespace Content.Server.Medical.Components
// Ideally this ends with GameTicker & CloningSystem handing DNA to a function that sets up a body for that DNA.
var mindUser = mind.UserId;
if (mindUser == null)
if (mindUser.HasValue == false || mind.Session == null)
{
// For now assume this means soul departed
obj.Session.AttachedEntity.Value.PopupMessageCursor(Loc.GetString("medical-scanner-component-msg-soul-broken"));
break;
}
// has to be explicit cast like this, IDK why, null suppression operators seem to not work
var profile = GetPlayerProfileAsync((NetUserId) mindUser);
var profile = GetPlayerProfileAsync(mindUser.Value);
cloningSystem.AddToDnaScans(new ClonerDNAEntry(mind, profile));
}