From 6e3a04f7b6608852cccf9652e5c18c492218af18 Mon Sep 17 00:00:00 2001 From: SimonFlapse Date: Tue, 18 Feb 2020 19:34:45 +0100 Subject: [PATCH] Added check to prevent crash when using debugging option --- map_gen/maps/diggy/debug.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/map_gen/maps/diggy/debug.lua b/map_gen/maps/diggy/debug.lua index 0c693cba9..404642be7 100644 --- a/map_gen/maps/diggy/debug.lua +++ b/map_gen/maps/diggy/debug.lua @@ -79,6 +79,10 @@ function Debug.print_grid_value(value, surface, position, scale, offset, immutab end end + if not(surface and surface.valid) then + return + end + if not immutable then local text_entity = surface.find_entity('flying-text', position)