Coverity: Dereference after null check
This commit is contained in:
@@ -366,7 +366,7 @@ void QGIViewBalloon::setViewPartFeature(TechDraw::DrawViewBalloon *balloon)
|
||||
DrawView* balloonParent = nullptr;
|
||||
double scale = 1.0;
|
||||
App::DocumentObject* docObj = balloon->SourceView.getValue();
|
||||
if (docObj == nullptr) {
|
||||
if (docObj) {
|
||||
balloonParent = dynamic_cast<DrawView*>(docObj);
|
||||
if (balloonParent)
|
||||
scale = balloonParent->getScale();
|
||||
|
||||
@@ -97,8 +97,10 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
|
||||
if (m_cl == nullptr) { //checked by CommandAnnotate. Should never happen.
|
||||
Base::Console().Message("TCL::TCL() - no centerline found\n");
|
||||
}
|
||||
m_type = m_cl->m_type;
|
||||
m_mode = m_cl->m_mode;
|
||||
else {
|
||||
m_type = m_cl->m_type;
|
||||
m_mode = m_cl->m_mode;
|
||||
}
|
||||
|
||||
setUiEdit();
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat):
|
||||
m_basePage = m_baseFeat->findParentPage();
|
||||
if (m_basePage == nullptr) {
|
||||
Base::Console().Error("TaskDetail - bad parameters - base page. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
m_baseName = m_baseFeat->getNameInDocument();
|
||||
|
||||
@@ -421,7 +421,9 @@ void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
|
||||
if (m_basePage != nullptr) {
|
||||
m_basePage->touch();
|
||||
}
|
||||
m_lineFeat->requestPaint();
|
||||
if (m_lineFeat != nullptr) {
|
||||
m_lineFeat->requestPaint();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskLeaderLine::updateLeaderFeature(void)
|
||||
|
||||
Reference in New Issue
Block a user