From 845ba0352756da2dafcd36426a41ea1fcfd2b953 Mon Sep 17 00:00:00 2001 From: Azumgi <4zumgi@gmail.com> Date: Fri, 4 Jan 2019 14:15:19 +0300 Subject: [PATCH] [Custom View] Fix loading screen reloading crash --- vmf/scripts/mods/vmf/modules/gui/custom_views.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vmf/scripts/mods/vmf/modules/gui/custom_views.lua b/vmf/scripts/mods/vmf/modules/gui/custom_views.lua index 899314c..3540b50 100644 --- a/vmf/scripts/mods/vmf/modules/gui/custom_views.lua +++ b/vmf/scripts/mods/vmf/modules/gui/custom_views.lua @@ -114,7 +114,7 @@ end local function remove_injected_views(on_reload) -- These elements should be removed only on_reload, because, otherwise, they will be deleted automatically. - if on_reload and _ingame_ui then + if on_reload then -- If some custom view is active, close it. if _views_data[_ingame_ui.current_view] then _ingame_ui:handle_transition("exit_menu") @@ -350,7 +350,9 @@ end) -- ##################################################################################################################### function vmf.remove_custom_views() - remove_injected_views(true) + if _ingame_ui then + remove_injected_views(true) + end end