diff --git a/routes/get.js b/routes/get.js index 82429d9..c08adba 100644 --- a/routes/get.js +++ b/routes/get.js @@ -1,10 +1,10 @@ function htmlEncode (str) { - return str.replace(/&/g, '&') + return str ? str.replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') - .replace(/\//g, '/'); + .replace(/\//g, '/') : ''; } module.exports = async (ctx) => {