Fix "any" for unknown types
This commit is contained in:
@@ -114,7 +114,7 @@ namespace chaiscript {
|
|||||||
template<typename ToType>
|
template<typename ToType>
|
||||||
ToType &cast() const
|
ToType &cast() const
|
||||||
{
|
{
|
||||||
if (typeid(ToType) == m_data->type())
|
if (m_data && typeid(ToType) == m_data->type())
|
||||||
{
|
{
|
||||||
return *static_cast<ToType *>(m_data->data());
|
return *static_cast<ToType *>(m_data->data());
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user