diff --git a/dtool/src/cppparser/cppExtensionType.cxx b/dtool/src/cppparser/cppExtensionType.cxx index bf0b963378..f82735274d 100644 --- a/dtool/src/cppparser/cppExtensionType.cxx +++ b/dtool/src/cppparser/cppExtensionType.cxx @@ -211,7 +211,7 @@ is_equivalent(const CPPType &other) const { // We consider two different extension types to be equivalent if they have // the same name. - return *_ident == *ot->_ident; + return _ident != nullptr && ot->_ident != nullptr && *_ident == *ot->_ident; } /** diff --git a/dtool/src/cppparser/cppScope.cxx b/dtool/src/cppparser/cppScope.cxx index af6404e4dd..d091cae756 100644 --- a/dtool/src/cppparser/cppScope.cxx +++ b/dtool/src/cppparser/cppScope.cxx @@ -164,8 +164,10 @@ define_typedef_type(CPPTypedefType *type, CPPPreprocessor *error_sink) { errstr << " has conflicting declaration as "; other_type->output(errstr, 0, nullptr, true); error_sink->error(errstr.str(), type->_ident->_loc); - error_sink->error("previous definition is here", - other_td->_ident->_loc); + if (other_td != nullptr && other_td->_ident != nullptr) { + error_sink->error("previous definition is here", + other_td->_ident->_loc); + } } } } else {