Temporary Fix When Element Is Null
Summary: a bug found while trying to use multiple selector on Wilde. The data returned from specific call is not in the form that we expect. This caused an exception on layout plugin when using the selector Specifically in WIlde, when we try to get data from node by calling client side to return it, sometimes the node has been invalidated or not saved. Hence, data returned are null or undefined. However, in previous implementation, this didn't take into consideration because we assumed that we always got correct data from client. Reviewed By: mweststrate Differential Revision: D21410989 fbshipit-source-id: 5135578606678973b504c9be897cb48fca547555
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f4c209bc1c
commit
5ccc392135
@@ -517,9 +517,13 @@ export class Elements extends PureComponent<ElementsProps, ElementsState> {
|
||||
} else {
|
||||
const virtualRoots: Set<string> = new Set();
|
||||
Object.keys(props.elements).forEach((id) => virtualRoots.add(id));
|
||||
Object.values(props.elements).forEach((element) =>
|
||||
element.children.forEach((id) => virtualRoots.delete(id)),
|
||||
);
|
||||
for (const [currentId, element] of Object.entries(props.elements)) {
|
||||
if (!element) {
|
||||
virtualRoots.delete(currentId);
|
||||
} else {
|
||||
element.children.forEach((id) => virtualRoots.delete(id));
|
||||
}
|
||||
}
|
||||
virtualRoots.forEach((id) => seed(id, 1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user