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:
Jacques Lucke
2023-01-10 17:13:12 +01:00
parent db688b62f9
commit 8a3a1a0c14

View File

@@ -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_);
}
/**