App: Bugfix for NULL-Pointer dereference of Property->getName()

This commit is contained in:
wmayer
2022-01-16 14:30:51 +01:00
parent 8525033bcc
commit b35623e680
14 changed files with 40 additions and 16 deletions

View File

@@ -66,8 +66,8 @@ PyObject* GeoFeaturePy::getPropertyNameOfGeometry(PyObject * args)
GeoFeature* object = this->getGeoFeaturePtr();
const PropertyComplexGeoData* prop = object->getPropertyOfGeometry();
const char* name = prop ? prop->getName() : 0;
if (name) {
const char* name = prop ? prop->getName() : nullptr;
if (Property::isValidName(name)) {
return Py::new_reference_to(Py::String(std::string(name)));
}
return Py::new_reference_to(Py::None());