Merge pull request #194 from Nava2/require-file-fix

Add check for validity with object in `require_file`
This commit is contained in:
The Phantom Derpstorm 2016-08-22 20:34:45 -04:00 committed by GitHub
commit a7423a5005

View File

@ -94,7 +94,7 @@ namespace sol {
template <typename Fx>
object require_core(const std::string& key, Fx&& action, bool create_global = true) {
optional<object> loaded = is_loaded_package(key);
if (loaded)
if (loaded && loaded->valid())
return std::move(*loaded);
action();
auto sr = stack::get<stack_reference>(L);