Fixes chem master replace beaker runtime (#76062)

## About The Pull Request

I think it was rather silly to put this call in this proc, but I'm not
about to audit it

`new_beaker` can be `null` if this proc is being called to drop the
current beaker, so this needed a sanity check

## Why It's Good For The Game

Runtime

## Changelog

🆑 Melbert
fix: Runtime from ejecting beakers from a chem-master
/🆑
This commit is contained in:
MrMelbert
2023-06-15 20:52:32 -05:00
committed by GitHub
parent 806e797c9b
commit 438decaa8f
@@ -201,7 +201,7 @@ GLOBAL_LIST_INIT(chem_master_containers, list(
/// Insert new beaker and/or eject the inserted one
/obj/machinery/chem_master/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(!user?.transferItemToLoc(new_beaker, src))
if(new_beaker && user && !user.transferItemToLoc(new_beaker, src))
return FALSE
if(beaker)
try_put_in_hand(beaker, user)