BISERVER-7710 - Improve error handling when calling window.top object

What was done:
1) added exception handling to the calls