Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Commit

Permalink
fixes empty tag bug
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtreece committed Jun 23, 2014
1 parent 8b5ddb7 commit f72760c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions routes/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,28 @@ exports.view = function(req, res, next) {
exports.create = function(req, res, next) {

var self = this,
stream = {},
passMessage = PassMessage.bind(this, req, res, next);

var stream = {
title: '',
description: '',
tags: [],
fields: [],
hidden: false
};

if (req.param('check') !== '') {
return passMessage(400, 'Are you a human? Bot check failed.', '/streams/make');
}

if (req.param('tags').trim()) {
stream.tags = req.param('tags').split(',').map(function(tag) {
stream.tags = req.param('tags').trim().split(',').map(function(tag) {
return tag.trim();
});
}

if (req.param('fields').trim()) {
stream.fields = req.param('fields').split(',').map(function(field) {
stream.fields = req.param('fields').trim().split(',').map(function(field) {
return field.trim();
});
}
Expand Down

0 comments on commit f72760c

Please sign in to comment.