App: Bugfix for NULL-Pointer dereference of Property->getName()
This commit is contained in:
@@ -236,7 +236,7 @@ struct ShapeCache {
|
||||
|
||||
void slotChanged(const App::DocumentObject &obj, const App::Property &prop) {
|
||||
const char *propName = prop.getName();
|
||||
if(!propName)
|
||||
if(!App::Property::isValidName(propName))
|
||||
return;
|
||||
if(strcmp(propName,"Shape")==0
|
||||
|| strcmp(propName,"Group")==0
|
||||
|
||||
@@ -340,7 +340,7 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st
|
||||
|
||||
App::Property* cprop = *it++;
|
||||
|
||||
if( strcmp(prop->getName(), "Label") == 0 ) {
|
||||
if( prop->getName() && strcmp(prop->getName(), "Label") == 0 ) {
|
||||
static_cast<App::PropertyString*>(cprop)->setValue(name.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ void relinkToBody (PartDesign::Feature *feature) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !valueStr.empty () ) {
|
||||
if ( !valueStr.empty () && prop->hasName()) {
|
||||
FCMD_OBJ_CMD(obj,prop->getName() << '=' << valueStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ App::Property *DlgSheetConf::prepare(CellAddress &from, CellAddress &to,
|
||||
vexpr->getPath().getProperty());
|
||||
if(prop) {
|
||||
auto obj = Base::freecad_dynamic_cast<DocumentObject>(prop->getContainer());
|
||||
if(obj) {
|
||||
if (obj && prop->hasName()) {
|
||||
path = ObjectIdentifier(sheet);
|
||||
path.setDocumentObjectName(obj,true);
|
||||
path << ObjectIdentifier::SimpleComponent(prop->getName());
|
||||
|
||||
Reference in New Issue
Block a user