diff --git a/code/controllers/subsystems/statpanel.dm b/code/controllers/subsystems/statpanel.dm index 4365927b632..c8241d9b5d2 100644 --- a/code/controllers/subsystems/statpanel.dm +++ b/code/controllers/subsystems/statpanel.dm @@ -59,7 +59,7 @@ SUBSYSTEM_DEF(statpanels) var/client/target = currentrun[length(currentrun)] currentrun.len-- - if(!target.stat_panel.is_ready()) + if(!target?.stat_panel?.is_ready()) continue if(target.stat_tab == "Status" && num_fires % status_wait == 0) @@ -217,6 +217,8 @@ SUBSYSTEM_DEF(statpanels) refresh_client_obj_view(target) /datum/controller/subsystem/statpanels/proc/refresh_client_obj_view(client/refresh) + if(!refresh.stat_panel) + return var/list/turf_items = return_object_images(refresh) if(!length(turf_items) || !refresh.mob?.listed_turf) return diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 04e976dacbd..fb072c886ed 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -364,7 +364,6 @@ GLOBAL_LIST_INIT(localhost_addresses, list( dir = NORTH - GLOB.clients += src GLOB.directory[ckey] = src connection_time = world.time connection_realtime = world.realtime @@ -382,6 +381,7 @@ GLOBAL_LIST_INIT(localhost_addresses, list( // Instantiate stat panel stat_panel = new(src, "statbrowser") stat_panel.subscribe(src, PROC_REF(on_stat_panel_message)) + GLOB.clients += src // Instantiate tgui panel tgui_panel = new(src, "browseroutput") tgui_say = new(src, "tgui_say") diff --git a/html/changelogs/hellfirejag-statpanel-runtime-fix.yml b/html/changelogs/hellfirejag-statpanel-runtime-fix.yml new file mode 100644 index 00000000000..4d89ec62cdf --- /dev/null +++ b/html/changelogs/hellfirejag-statpanel-runtime-fix.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed a runtime error caused by a player attempting to view the statpanel before its ready."