Hi Team,
Can you please ensure that this function is robust by adding this change? Dont know what's the impact on existing test cases.
File: SynchronizedOverlay.ts
* @param {Node} node The node to remove the children from.
*/
function removeChildren(node: Node) {
while (node.lastChild) {
node.removeChild(node.lastChild);
}
}
Error:
removeChildren - SynchronizedOverlay.ts:22:9
TypeError: can't access property "lastChild", node is null
Fix Proposal:
function removeChildren(node: Node) {
if (!node) {
return;
}
while (node.lastChild) {
node.removeChild(node.lastChild);
}
}
Many thanks in advance!