Fix AttributeStrings tests

Summary: This diff fixes AttributeStrings tests

Reviewed By: shergin

Differential Revision: D10349107

fbshipit-source-id: c03407bf057535ebbb75ccf02d03f76fbc3cd360
This commit is contained in:
David Vacca 2018-10-11 23:01:57 -07:00 committed by Facebook Github Bot
parent 436cf154bb
commit ee4e2ae489
1 changed files with 3 additions and 1 deletions

View File

@ -478,7 +478,9 @@ inline folly::dynamic toDynamic(const AttributedString &attributedString) {
for (auto fragment : attributedString.getFragments()) {
folly::dynamic dynamicFragment = folly::dynamic::object();
dynamicFragment["string"] = fragment.string;
dynamicFragment["reactTag"] = fragment.parentShadowNode->getTag();
if (fragment.parentShadowNode) {
dynamicFragment["reactTag"] = fragment.parentShadowNode->getTag();
}
dynamicFragment["textAttributes"] = toDynamic(fragment.textAttributes);
fragments.push_back(dynamicFragment);
}