This commit is contained in:
Federico Cecchetto
2021-05-29 23:17:24 +02:00
parent dc2d8135cd
commit d2c9e8c2e8
2 changed files with 53 additions and 32 deletions

View File

@ -51,6 +51,13 @@ namespace scripting
throw std::runtime_error("Invalid type");
}
const auto value = this->get<int>();
if (!value)
{
throw std::runtime_error("Null pointer");
}
return reinterpret_cast<T*>(this->get<int>());
}