From 7ad195e9407b2a59ee7762e4ac0e238242ec67cd Mon Sep 17 00:00:00 2001 From: Joshua Gould Date: Thu, 12 May 2016 15:05:02 -0400 Subject: [PATCH] check for png too large --- src/ui/heat_map.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/heat_map.js b/src/ui/heat_map.js index 03778fa..3702924 100644 --- a/src/ui/heat_map.js +++ b/src/ui/heat_map.js @@ -2925,8 +2925,12 @@ morpheus.HeatMap.prototype = { var context = canvas.getContext('2d'); this.snapshot(context); canvas.toBlob(function (blob) { - if (blob.size === 0) { - throw 'Image is too large.'; + if (blob == null || blob.size === 0) { + morpheus.FormBuilder.showInModal({ + title: 'Save Image', + html: 'Image is too large to save.' + }); + return; } saveAs(blob, file, true); -- GitLab