Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better error output when using flash without session middleware.

  • Loading branch information...
commit be7068f5693fcfa8bcfcc752947cc3d74cf26107 1 parent b122bf2
@masylum masylum authored tj committed
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/request.js
View
1  lib/request.js
@@ -190,6 +190,7 @@ req.param = function(name, defaultValue){
*/
req.flash = function(type, msg){
+ if (this.session === undefined) throw Error('You must enable session middleware!');
var msgs = this.session.flash = this.session.flash || {};
if (type && msg) {
var i = 2
Please sign in to comment.
Something went wrong with that request. Please try again.