Coverity: Dereference null return value
This commit is contained in:
@@ -1823,8 +1823,8 @@ void TreeWidget::dropEvent(QDropEvent *event)
|
||||
std::string dropName;
|
||||
ss.str("");
|
||||
if(da == Qt::LinkAction) {
|
||||
if(targetItemObj->getParentItem()) {
|
||||
auto parentItem = targetItemObj->getParentItem();
|
||||
auto parentItem = targetItemObj->getParentItem();
|
||||
if (parentItem) {
|
||||
ss << Command::getObjectCmd(
|
||||
parentItem->object()->getObject(),0,".replaceObject(",true)
|
||||
<< Command::getObjectCmd(targetObj) << ","
|
||||
|
||||
@@ -205,17 +205,19 @@ void TaskDressUpParameters::setSelection(QListWidgetItem* current) {
|
||||
std::string docName = DressUpView->getObject()->getDocument()->getName();
|
||||
// get the name of the body we are in
|
||||
Part::BodyBase* body = PartDesign::Body::findBodyOf(DressUpView->getObject());
|
||||
std::string objName = body->getNameInDocument();
|
||||
if (body) {
|
||||
std::string objName = body->getNameInDocument();
|
||||
|
||||
// hide fillet to see the original edge
|
||||
// (a fillet creates new edges so that the original one is not available)
|
||||
hideObject();
|
||||
// highlight all objects in the list
|
||||
DressUpView->highlightReferences(true);
|
||||
// clear existing selection because only the current item is highlighted, not all selected ones to keep the overview
|
||||
Gui::Selection().clearSelection();
|
||||
// highligh the selected item
|
||||
Gui::Selection().addSelection(docName.c_str(), objName.c_str(), subName.c_str(), 0, 0, 0);
|
||||
// hide fillet to see the original edge
|
||||
// (a fillet creates new edges so that the original one is not available)
|
||||
hideObject();
|
||||
// highlight all objects in the list
|
||||
DressUpView->highlightReferences(true);
|
||||
// clear existing selection because only the current item is highlighted, not all selected ones to keep the overview
|
||||
Gui::Selection().clearSelection();
|
||||
// highligh the selected item
|
||||
Gui::Selection().addSelection(docName.c_str(), objName.c_str(), subName.c_str(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -659,6 +659,9 @@ PyObject* DrawViewPartPy::getEdgeByIndex(PyObject *args)
|
||||
//this is scaled and +Yup
|
||||
//need unscaled and +Ydown
|
||||
TechDraw::BaseGeom* geom = dvp->getGeomByIndex(edgeIndex);
|
||||
if (geom == nullptr) {
|
||||
throw Py::ValueError("wrong edgeIndex");
|
||||
}
|
||||
|
||||
TopoDS_Shape temp = TechDraw::mirrorShapeVec(geom->occEdge,
|
||||
Base::Vector3d(0.0, 0.0, 0.0),
|
||||
@@ -679,6 +682,9 @@ PyObject* DrawViewPartPy::getVertexByIndex(PyObject *args)
|
||||
//this is scaled and +Yup
|
||||
//need unscaled and +Ydown
|
||||
TechDraw::Vertex* vert = dvp->getProjVertexByIndex(vertexIndex);
|
||||
if (vert == nullptr) {
|
||||
throw Py::ValueError("wrong vertIndex");
|
||||
}
|
||||
Base::Vector3d point = DrawUtil::invertY(vert->point()) / dvp->getScale();
|
||||
|
||||
gp_Pnt gPoint(point.x, point.y, point.z);
|
||||
|
||||
@@ -389,7 +389,9 @@ void TaskRichAnno::createAnnoFeature()
|
||||
if (m_basePage != nullptr) {
|
||||
m_basePage->touch();
|
||||
}
|
||||
m_annoFeat->requestPaint();
|
||||
if (m_annoFeat != nullptr) {
|
||||
m_annoFeat->requestPaint();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskRichAnno::updateAnnoFeature()
|
||||
|
||||
Reference in New Issue
Block a user