Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -rf2051d168949fd1bfc8c6277799f1ef2be31301e -rd0d5266025fe26bb0c984f5bc472e81c5532ea3a --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision f2051d168949fd1bfc8c6277799f1ef2be31301e) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision d0d5266025fe26bb0c984f5bc472e81c5532ea3a) @@ -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 $('