Merge pull request #2637 from overleaf/jpa-hotfix-graceful-session-access

[ErrorController] handleError: access session gracefully

GitOrigin-RevId: 90c8ce0be80f5f198139a3b079c3a81e200112db
This commit is contained in:
Timothée Alby 2020-02-28 10:08:32 -05:00 committed by Copybot
parent 42aa999af6
commit e7f968d370

View file

@ -23,7 +23,7 @@ module.exports = ErrorController = {
handleError(error, req, res, next) { handleError(error, req, res, next) {
const user = AuthenticationController.getSessionUser(req) const user = AuthenticationController.getSessionUser(req)
// log errors related to SAML flow // log errors related to SAML flow
if (req.session.saml) { if (req.session && req.session.saml) {
SamlLogHandler.log(req.session.saml.universityId, req.sessionID, { SamlLogHandler.log(req.session.saml.universityId, req.sessionID, {
error: { error: {
message: error && error.message, message: error && error.message,