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 <evilexecutive@gmail.com>
This commit is contained in:
sentry[bot]
2026-08-19 18:07:53 +00:00
committed by GitHub
co-authored by VMSolidus
parent 1b93c850ca
commit 85ec63da94
2 changed files with 5 additions and 1 deletions
@@ -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.
@@ -0,0 +1,4 @@
author: Hellfirejag
delete-after: True
changes:
- bugfix: "Fixed a small lag spike caused by ownerless IPCs dying."