GUAC-690: Do not attempt to create empty thumbnails. Do not create thumbnails if client not attached.

This commit is contained in:
Michael Jumper
2014-05-20 11:24:41 -07:00
parent 58e828bf2d
commit 9b3b0dbbeb

View File

@@ -738,8 +738,16 @@ GuacUI.Client.Pinch = function(element) {
*/
GuacUI.Client.updateThumbnail = function() {
var guac = GuacUI.Client.attachedClient;
if (!guac)
return;
// Do not create empty thumbnails
if (guac.getDisplay().getWidth() <= 0 || guac.getDisplay().getHeight() <= 0)
return;
// Get screenshot
var canvas = GuacUI.Client.attachedClient.getDisplay().flatten();
var canvas = guac.getDisplay().flatten();
// Calculate scale of thumbnail (max 320x240, max zoom 100%)
var scale = Math.min(