diff options
author | Hans Goudey <h.goudey@me.com> | 2021-10-21 01:45:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-21 01:45:14 +0300 |
commit | 6b761c59d25855080de683d15837f31172745f43 (patch) | |
tree | 3a7189be788290f9a2104aaea4e02447d49c8125 /source/blender/blenkernel/intern/geometry_component_curve.cc | |
parent | 3f8b45d8d1fff8a082e3d35221d39854484e8551 (diff) |
Fix: Empty id attribute on curve control points
No virtual array should be returned instead of returning an empty span.
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curve.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index 2f2851b4fd4..f30ff2a70a7 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -1104,6 +1104,10 @@ template<typename T> class BuiltinPointAttributeProvider : public BuiltinAttribu return {}; } + if (!this->exists(component)) { + return {}; + } + Span<SplinePtr> splines = curve->splines(); if (splines.size() == 1) { return std::make_unique<fn::GVArray_For_GSpan>(get_span_(*splines.first())); @@ -1125,6 +1129,10 @@ template<typename T> class BuiltinPointAttributeProvider : public BuiltinAttribu return {}; } + if (!this->exists(component)) { + return {}; + } + MutableSpan<SplinePtr> splines = curve->splines(); if (splines.size() == 1) { return std::make_unique<fn::GVMutableArray_For_GMutableSpan>( |