diff --git a/src/routes/write/index.js b/src/routes/write/index.js index b62ca2fcc0..40e00ac9bb 100644 --- a/src/routes/write/index.js +++ b/src/routes/write/index.js @@ -65,5 +65,7 @@ Write.reload = async (params) => { }; Write.cleanup = (req) => { - req.session.destroy(); + if (req && req.session) { + req.session.destroy(); + } };