fixed return in posts.create

v1.18.x
Baris Usakli 11 years ago
parent ab63ca6d92
commit 9ca10c25d4

@ -21,15 +21,14 @@ var db = require('./database'),
Posts.create = function(uid, tid, content, callback) {
if (uid === null) {
callback(new Error('invalid-user'), null);
return;
return callback(new Error('invalid-user'), null);
}
topics.isLocked(tid, function(err, locked) {
if(err) {
return callback(err, null);
} else if(locked) {
callback(new Error('topic-locked'), null);
return callback(new Error('topic-locked'), null);
}
db.incrObjectField('global', 'nextPid', function(err, pid) {

Loading…
Cancel
Save