diff --git a/jsketch.svg.js b/jsketch.svg.js index b36e509..48109ac 100644 --- a/jsketch.svg.js +++ b/jsketch.svg.js @@ -21,6 +21,8 @@ * @name toSVG */ window.jSketch.prototype.toSVG = function(callback) { + // No callback, no SVG. + if (typeof callback !== 'function') throw new Error('You must supply a callback in toSVG() method.'); // Save pointer for use in closures. var self = this; // Gather lines together until path is closed. @@ -192,6 +194,7 @@ */ methods.stroke = methods.closePath; + // Create SVG. function build() { var svg = ''; svg += '