diff --git a/src/routes/api/import.js b/src/routes/api/import.js index f37276502..8fea221f4 100644 --- a/src/routes/api/import.js +++ b/src/routes/api/import.js @@ -33,6 +33,10 @@ async function importToBranch(req) { } function toHtml(text) { + if (!text) { + return ''; + } + return '
' + text.replace(/(?:\r\n|\r|\n)/g, '
') + '
'; } diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js index daeece1da..2696bd65e 100644 --- a/src/routes/api/tree.js +++ b/src/routes/api/tree.js @@ -56,7 +56,7 @@ async function load(req) { const branchIds = req.body.branchIds; if (branchIds && branchIds.length > 0) { - noteIds = (await sql.getColumn(`SELECT noteId FROM branches WHERE isDeleted = 0 AND branchId IN(???)`, branchIds)) + noteIds = (await sql.getManyRows(`SELECT noteId FROM branches WHERE isDeleted = 0 AND branchId IN(???)`, branchIds)) .map(note => note.noteId); }