Fix T103781: assert when connecting viewer node on mesh without faces
`Span.data()` does not have to be `nullptr` when the size is zero. This happens e.g. when slicing a span to a size of zero.
This commit is contained in:
@@ -89,11 +89,8 @@ class GArray {
|
||||
*/
|
||||
GArray(const GSpan span, Allocator allocator = {}) : GArray(span.type(), span.size(), allocator)
|
||||
{
|
||||
if (span.data() != nullptr) {
|
||||
BLI_assert(span.size() != 0);
|
||||
/* Use copy assign rather than construct since the memory is already initialized. */
|
||||
type_->copy_assign_n(span.data(), data_, size_);
|
||||
}
|
||||
/* Use copy assign rather than construct since the memory is already initialized. */
|
||||
type_->copy_assign_n(span.data(), data_, size_);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user