From 52aa79eca0fe7260875ead9597cbf2a10ba32a0d Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 19 Nov 2023 18:14:48 +0100 Subject: [PATCH] [MIRROR] Fixes a race condition in mutations code [MDB IGNORE] (#25116) * Fixes a race condition in mutations code (#79829) ## About The Pull Request One of the timers has a callback to the `modify()` proc which also doesn't check whether the mutation owner has been deleted since the timer began, potentially resulting in a runtime. ![image](https://github.com/tgstation/tgstation/assets/13398309/1e41c48b-2620-4473-9278-702d490871cc) ## Why It's Good For The Game Fixes bugs ## Changelog :cl: fix: fixed a race condition with mutations /:cl: * Fixes a race condition in mutations code --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- code/datums/mutations/_mutations.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/mutations/_mutations.dm b/code/datums/mutations/_mutations.dm index b897c4c81a6..176fb9d8388 100644 --- a/code/datums/mutations/_mutations.dm +++ b/code/datums/mutations/_mutations.dm @@ -177,7 +177,7 @@ * returns an instance of a power if modification was complete */ /datum/mutation/human/proc/modify() - if(modified || !power_path || !owner) + if(modified || !power_path || QDELETED(owner)) return var/datum/action/cooldown/modified_power = locate(power_path) in owner.actions if(!modified_power)