diff --git a/guacamole/src/main/webapp/app/rest/services/tunnelService.js b/guacamole/src/main/webapp/app/rest/services/tunnelService.js index f74088d4b..c6d5ed412 100644 --- a/guacamole/src/main/webapp/app/rest/services/tunnelService.js +++ b/guacamole/src/main/webapp/app/rest/services/tunnelService.js @@ -224,7 +224,9 @@ angular.module('rest').factory('tunnelService', ['$injector', // ends, in the browser does NOT fire the "load" event for downloads stream.onend = function downloadComplete() { $window.setTimeout(function cleanupIframe() { - document.body.removeChild(iframe); + if (iframe.parentElement) { + document.body.removeChild(iframe); + } }, DOWNLOAD_CLEANUP_WAIT); };