diff --git a/lib/cartodb/template_maps.js b/lib/cartodb/template_maps.js index 829a2fea..e1019f24 100644 --- a/lib/cartodb/template_maps.js +++ b/lib/cartodb/template_maps.js @@ -291,6 +291,9 @@ o.delTemplate = function(owner, tpl_id, callback) { }, function delCertificate(err, tplval) { if ( err ) throw err; + if ( ! tplval ) { + throw new Error("Template '" + tpl_id + "' of user '" + owner + "' does not exist"); + } var tpl = JSON.parse(tplval); if ( ! tpl.auth_id ) { // not sure this is an error, in case we'll ever