Skip to content

Node.js based forum software built for the modern web

topic creation now checks for valid pid as well

Julian Lam86af1b2af51d
diff --git a/src/topics.js b/src/topics.js
index 310cbe2448..f58d8632dd 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -149,7 +149,7 @@ var RDB = require('./redis.js'),
// Posts
posts.create(uid, tid, content, function(pid) {
- RDB.lpush('tid:' + tid + ':posts', pid);
+ if (pid > 0) RDB.lpush('tid:' + tid + ':posts', pid);
});