From 017df40b335a97e447b3821b1acbb3bc7120c180 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 6 Feb 2018 20:11:30 -0800 Subject: [PATCH] GUACAMOLE-348: Only remove download iframe if it's still attached to the DOM. --- guacamole/src/main/webapp/app/rest/services/tunnelService.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); };