From f77d9a727059f2aece992176013db7467c045fd7 Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Sun, 19 Nov 2023 12:08:59 -0500 Subject: [PATCH] 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: --- 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 9ea3c8dfb17..82e948ec44f 100644 --- a/code/datums/mutations/_mutations.dm +++ b/code/datums/mutations/_mutations.dm @@ -173,7 +173,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)