Skip to content

Commit

Permalink
[MIRROR] Fixes a race condition in mutations code [MDB IGNORE] (#25116)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Nov 19, 2023
1 parent 03d2d75 commit 52aa79e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/datums/mutations/_mutations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 52aa79e

Please sign in to comment.