Blender And A Null Pointer

ReadAttributePtr try_get_for_read(
const GeometryComponent &component,
const StringRef attribute_name) const final
{
....
const Mesh *mesh = mesh_component.get_for_read();
....
if (mesh == nullptr || mesh->dvert == nullptr) {
static const float default_value = 0.0f;
return std::make_unique<ConstantReadAttribute>(
ATTR_DOMAIN_POINT, mesh->totvert,
CPPType::get<float>(), &default_value);
}
....
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrey Karpov

Andrey Karpov

Co-founder of the PVS-Studio project. Microsoft MVP in the ‘Developer Technologies’ nomination and PhD in Physics and Mathematics.