mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-01-01 03:12:23 +08:00
Fix "any" for unknown types
This commit is contained in:
parent
92de42e42b
commit
abfd37644e
@ -114,7 +114,7 @@ namespace chaiscript {
|
||||
template<typename ToType>
|
||||
ToType &cast() const
|
||||
{
|
||||
if (typeid(ToType) == m_data->type())
|
||||
if (m_data && typeid(ToType) == m_data->type())
|
||||
{
|
||||
return *static_cast<ToType *>(m_data->data());
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user