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

🆑
fix: fixed a race condition with mutations
/🆑
This commit is contained in:
Bloop
2023-11-19 18:08:59 +01:00
committed by GitHub
parent e1c5297aa7
commit f77d9a7270
+1 -1
View File
@@ -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)