Fabric: Added assert in ShadowNode

Summary:
It's not allowed to return nullptr from the callback. The assert ensures it which is helpful during development.

Probably, we should consider using `gsl::not_null<>` here.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D21149891

fbshipit-source-id: a5f77b35029f22b499491721036405682f812a38
This commit is contained in:
Valentin Shergin 2020-04-24 21:24:27 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 81734276b9
Коммит fef8bc33df
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -263,6 +263,10 @@ ShadowNode::Unshared ShadowNode::cloneTree(
auto newShadowNode = callback(*oldShadowNode);
assert(
newShadowNode &&
"`callback` returned `nullptr` which is not allowed value.");
auto childNode = newShadowNode;
for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {