Closed xiedacon closed 7 years ago
when i delete session by
ctx.session = null
it throws
TypeError: Cannot convert undefined or null to object
and fix it
// if is an empty object if(ctx.session !== null && typeof ctx.session === 'object' && !Object.keys(ctx.session).length) { ctx.session = null; }
@xiedacon I think instanceof is a better way to fix this bug. Also thanks for your PR! 😄
instanceof
that's right, instanceof is much better
when i delete session by
it throws
and fix it