From 85ec63da9443a4e8539b45dae2ed03ba4a42cbb7 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 18:07:53 +0000 Subject: [PATCH] Fix IPC posibrain die() null transfer (#23060) * Please describe the intent of your changes in a clear fashion. The `die()` proc for the positronic brain (`/obj/item/organ/internal/machine/posibrain/die()`) was attempting to transfer `owner.mind` to `stored_mmi.brainmob` without first checking if `owner.mind` was null. This led to a runtime error (`Cannot execute null.transfer to().`) when the IPC mob was mindless (e.g., an NPC, a disconnected player, or if the mind had already been transferred). This change adds a null-check (`if(owner.mind)`) around the `transfer_to()` call in `die()` at line 103 of `posibrain.dm`. This prevents the error by ensuring the transfer only occurs when a mind object actually exists, mirroring the safe pattern already present in the `removed()` proc. * Please make sure that, in the case of mapping changes, you include images of these changes in the PR's description. * Please make sure to mark your PR as wip or review required by making a comment with !wip or !review required * If you include sprites/sounds/... (assets) that you have not created yourself specify the license and original author below. * Ensure that you also credit them in the appropriate location / changelog as specified in the contributor guidelines ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/example.dmi | ExamplePerson (Example Station) | CC0 | Fixes [SERVER-PROD-RG](https://aurorastation.sentry.io/issues/7496141971/?seerDrawer=true) --------- Co-authored-by: VMSolidus --- code/modules/organs/internal/species/machine/posibrain.dm | 2 +- html/changelogs/hellfirejag-ipc-posibrain-fix.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/hellfirejag-ipc-posibrain-fix.yml diff --git a/code/modules/organs/internal/species/machine/posibrain.dm b/code/modules/organs/internal/species/machine/posibrain.dm index bf1e8f715a0..51b7e2af4b0 100644 --- a/code/modules/organs/internal/species/machine/posibrain.dm +++ b/code/modules/organs/internal/species/machine/posibrain.dm @@ -100,7 +100,7 @@ . = ..() to_chat(owner, SPAN_MACHINE_DANGER(FONT_LARGE("Your damage failsafes activate; your thought processes grind to a halt as your consciousness is cut off from the exterior world. No sensation or external input reaches you anymore."))) to_chat(owner, SPAN_DANGER(FONT_LARGE("You are now in an emergency low power mode, so that your posibrain can still survive despite your chassis being destroyed."))) - owner.mind.transfer_to(stored_mmi.brainmob) + owner?.mind?.transfer_to(stored_mmi.brainmob) /** * Helper proc to add fragmentation. diff --git a/html/changelogs/hellfirejag-ipc-posibrain-fix.yml b/html/changelogs/hellfirejag-ipc-posibrain-fix.yml new file mode 100644 index 00000000000..fb50bae7c3b --- /dev/null +++ b/html/changelogs/hellfirejag-ipc-posibrain-fix.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed a small lag spike caused by ownerless IPCs dying."