From df9fd05e0fce614e5de7c80d866d220a9f41abc9 Mon Sep 17 00:00:00 2001 From: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Date: Fri, 4 Nov 2022 03:47:59 -0400 Subject: [PATCH] fixes runtime (#19576) --- code/modules/library/library_equipment.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/library/library_equipment.dm b/code/modules/library/library_equipment.dm index f69cb1b6b29..db2fdadea8e 100644 --- a/code/modules/library/library_equipment.dm +++ b/code/modules/library/library_equipment.dm @@ -345,12 +345,15 @@ if(computer == library_computer) return TRUE //we're succesfully connected already, let player know it was a "succesful connection" - UnregisterSignal(computer, COMSIG_PARENT_QDELETING) + disconnect() //clear references to old computer, we have to unregister signals computer = library_computer RegisterSignal(library_computer, COMSIG_PARENT_QDELETING, .proc/disconnect) return TRUE /obj/item/barcodescanner/proc/disconnect() + if(!computer) + return //proc will runtime if computer is null + UnregisterSignal(computer, COMSIG_PARENT_QDELETING) computer = null /obj/item/barcodescanner/proc/scanID(obj/item/card/id/ID, mob/user)