Fixed possible segfault in package diagram generator

This commit is contained in:
Bartek Kryza
2023-05-16 08:56:08 +02:00
parent 9035ee52ac
commit 7dff400978

View File

@@ -388,7 +388,7 @@ bool translation_unit_visitor::find_relationships(const clang::QualType &type,
}
}
}
else if (type->isRecordType()) {
else if (type->isRecordType() && type->getAsCXXRecordDecl()) {
const auto *namespace_context =
type->getAsCXXRecordDecl()->getEnclosingNamespaceContext();
if (namespace_context != nullptr && namespace_context->isNamespace()) {