fixes #5786 Error in console when click on network portlet

Fixed the issue and pushed the code for review, please check it.