From a6c95dbb744254c625033f1fb15d448ffe7ef997 Mon Sep 17 00:00:00 2001 From: Kevin Brightwell Date: Mon, 22 Aug 2016 17:13:25 -0400 Subject: [PATCH] Add check for validity with object in `require_file` Closes #193 --- sol/state_view.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sol/state_view.hpp b/sol/state_view.hpp index caca3a50..f073dff0 100644 --- a/sol/state_view.hpp +++ b/sol/state_view.hpp @@ -94,7 +94,7 @@ namespace sol { template object require_core(const std::string& key, Fx&& action, bool create_global = true) { optional loaded = is_loaded_package(key); - if (loaded) + if (loaded && loaded->valid()) return std::move(*loaded); action(); auto sr = stack::get(L);