Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringGeneral.js,v diff -u -r1.51.2.64 -r1.51.2.65 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js 14 Feb 2017 09:40:18 -0000 1.51.2.64 +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 14 Feb 2017 10:29:11 -0000 1.51.2.65 @@ -2591,21 +2591,24 @@ * Stores SVG LD thumbnail on server. */ saveLearningDesignImage : function() { - var result = false; - $.ajax({ - type : 'POST', - url : LAMS_URL + 'authoring/author.do', - async: false, - data : { - 'method' : 'saveLearningDesignImage', - 'learningDesignID' : layout.ld.learningDesignID, - 'image' : MenuLib.exportSVG() - }, - success : function(){ - result = true; - } - }); - + var svg = MenuLib.exportSVG(), + result = false; + // check if canvas is not empty + if (svg !== undefined) { + $.ajax({ + type : 'POST', + url : LAMS_URL + 'authoring/author.do', + async: false, + data : { + 'method' : 'saveLearningDesignImage', + 'learningDesignID' : layout.ld.learningDesignID, + 'image' : MenuLib.exportSVG() + }, + success : function(){ + result = true; + } + }); + } return result; }, @@ -2660,18 +2663,22 @@ // the LD SVG is missing, try to re-generate it error : function(error) { // skip re-generate if it is an another error or generated SVG is empty - if ((error.status != 404) || (MenuLib.exportSVG() === undefined)) { + if (error.status != 404){ return; } // iframe just to load another instance of Authoring for a single purpose, generate the SVG $('