WFL: Prevent a crash if an object is destroyed before the formula is finished with it

This commit is contained in:
Celtic Minstrel 2021-03-23 00:32:51 -04:00
parent c6486bd7cc
commit 7756242160

View file

@ -279,7 +279,9 @@ std::size_t variant::num_elements() const
variant variant::get_member(const std::string& name) const
{
if(is_callable()) {
return value_cast<variant_callable>()->get_callable()->query_value(name);
if(auto obj = value_cast<variant_callable>()->get_callable()) {
return obj->query_value(name);
}
}
if(name == "self") {