summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2016-12-06 12:20:56 (GMT)
committerRalf Habacker <ralf.habacker@freenet.de>2016-12-06 12:20:56 (GMT)
commit80b341be5801373fb8237cdddbc56701dc397eb4 (patch)
tree71be13d8b95aae02c9705ed4567842255b649f42
parent3383c4505efbac99b74815d804e8770fbd5a1b34 (diff)
Fix crash on importing c++ code.
-rw-r--r--umbrello/codeimport/kdevcppparser/cpptree2uml.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp b/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
index 0ad63e6..7b76419 100644
--- a/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
+++ b/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
@@ -170,8 +170,13 @@ void CppTree2Uml::parseTypedef(TypedefAST* ast)
Import_Utils::createUMLObject(UMLObject::ot_Datatype, id,
m_currentNamespace[m_nsCnt]);
UMLDatatype *dt = typedefObj->asUMLDatatype();
- dt->setIsReference();
- dt->setOriginType(inner->asUMLClassifier());
+ if (dt) {
+ dt->setIsReference();
+ dt->setOriginType(inner->asUMLClassifier());
+ }
+ else {
+ uError() << "Could not create datatype from" << id;
+ }
} else {
Import_Utils::createUMLObject(UMLObject::ot_Class, id,
m_currentNamespace[m_nsCnt],