summaryrefslogtreecommitdiff
path: root/src/node/db
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-01-19 02:51:32 +0000
committerJohn McLear <john@mclear.co.uk>2015-01-19 02:51:32 +0000
commitcadb83ac5af0911e722812d934d3133735d46ced (patch)
tree1577c0ad14aa815b71ce51505ffc4b74a7f59d4a /src/node/db
parent73d6030762c9fc37819668826b88e087d4e5ad24 (diff)
downloadetherpad-lite-cadb83ac5af0911e722812d934d3133735d46ced.zip
bumpage
Diffstat (limited to 'src/node/db')
-rw-r--r--src/node/db/API.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/node/db/API.js b/src/node/db/API.js
index a9df2a12..07127309 100644
--- a/src/node/db/API.js
+++ b/src/node/db/API.js
@@ -410,7 +410,16 @@ exports.setHTML = function(padID, html, callback)
if(ERR(err, callback)) return;
// add a new changeset with the new html to the pad
- importHtml.setPadHTML(pad, cleanText(html), callback);
+ importHtml.setPadHTML(pad, cleanText(html), function(e){
+ if(e){
+ callback(new customError("HTML is malformed","apierror"));
+ return;
+ }else{
+ //update the clients on the pad
+ padMessageHandler.updatePadClients(pad, callback);
+ return;
+ }
+ });
//update the clients on the pad
padMessageHandler.updatePadClients(pad, callback);