check pid before setting cache

This commit is contained in:
barisusakli
2015-11-25 12:30:43 -05:00
parent 1c71001e1d
commit 9f48d3e6d2

View File

@@ -25,7 +25,7 @@ module.exports = function(Posts) {
return callback(err); return callback(err);
} }
if (global.env === 'production') { if (global.env === 'production' && data.postData.pid) {
cache.set(data.postData.pid, data.postData.content); cache.set(data.postData.pid, data.postData.content);
} }