Permalink
Browse files

Check to see if flash or header are previously defined.

  • Loading branch information...
1 parent c1563bc commit df66a16469b0c0ead7abce40f3d2fc2b1855a387 @kennyp kennyp committed May 1, 2012
Showing with 10 additions and 6 deletions.
  1. +10 −6 index.js
View
@@ -125,16 +125,20 @@ Whisper.prototype.makeRequest = function(data, callback) {
if (data.user) req.user = data.user;
// req flash placeholder
- req.flash = function(type, message){
- // console.log(type, message);
- };
+ if (typeof req.flash === 'undefined') {
+ req.flash = function(type, message){
+ // console.log(type, message);
+ };
+ }
// req session placeholder
req.session = {};
- req.header = function() {
- return '';
- };
+ if (typeof req.header === 'undefined') {
+ req.header = function() {
+ return '';
+ };
+ }
// req.query
req.query = {};

0 comments on commit df66a16

Please sign in to comment.