Commit 223a2a31 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix coverity CID 88359: Unchecked dynamic_cast

Passing null pointer doc to getParentClassifier, which dereferences it.

CCBUG:340646
parent acdf3c02
......@@ -37,6 +37,7 @@ void CPPSourceCodeOperation::updateContent()
{
CodeGenPolicyExt *pe = UMLApp::app()->policyExt();
CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe);
Q_ASSERT(policy);
bool isInlineMethod = policy->getOperationsAreInline();
if (!isInlineMethod) {
......@@ -47,8 +48,10 @@ void CPPSourceCodeOperation::updateContent()
void CPPSourceCodeOperation::updateMethodDeclaration()
{
CPPSourceCodeDocument * doc = dynamic_cast<CPPSourceCodeDocument*>(getParentDocument());
Q_ASSERT(doc);
CodeGenPolicyExt *pe = UMLApp::app()->policyExt();
CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe);
Q_ASSERT(policy);
UMLClassifier * c = doc->getParentClassifier();
UMLOperation * o = getParentOperation();
bool isInterface = doc->parentIsInterface();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment