LPS-36357 Avoid JS errors due not created DOM nodes (Not logic changes. Just Copy-Paste)