diff --git a/include/chaiscript/dispatchkit/any.hpp b/include/chaiscript/dispatchkit/any.hpp index 90b6336..23f1803 100644 --- a/include/chaiscript/dispatchkit/any.hpp +++ b/include/chaiscript/dispatchkit/any.hpp @@ -114,7 +114,7 @@ namespace chaiscript { template ToType &cast() const { - if (typeid(ToType) == m_data->type()) + if (m_data && typeid(ToType) == m_data->type()) { return *static_cast(m_data->data()); } else {