From 549319b82a910895f9360791784ae81f529a9863 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 16 Nov 2026 19:06:28 +0900 Subject: [PATCH] . --- exp_scenario/module/gui/vlayer.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exp_scenario/module/gui/vlayer.lua b/exp_scenario/module/gui/vlayer.lua index 94d690ac..30f396e1 100644 --- a/exp_scenario/module/gui/vlayer.lua +++ b/exp_scenario/module/gui/vlayer.lua @@ -257,9 +257,9 @@ local function surface_index_from_element(controls) local surface = 0 if element then local surface_name = element.items[element.selected_index] - if surface_name then - ---@diagnostic disable-next-line: undefined-field - surface = game.surfaces[surface_name].index + local s = game.surfaces[surface_name] + if surface_name and s then + surface = s.index end end return surface