Skip to content

Commit 0eb880b

Browse files
authored
ignore forum posts stored with zero id (ccbrown#25)
1 parent 76d9298 commit 0eb880b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/database.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ func (db *Database) Activity(start string, count int, filter func(Activity) bool
100100
if post.Host == "" {
101101
post.Host = "www.pathofexile.com"
102102
}
103-
activity = post
103+
if post.Id != 0 {
104+
activity = post
105+
}
104106
case RedditCommentType:
105107
comment := &RedditComment{}
106108
err := json.Unmarshal(v, comment)
@@ -116,7 +118,7 @@ func (db *Database) Activity(start string, count int, filter func(Activity) bool
116118
}
117119
activity = post
118120
}
119-
if filter == nil || filter(activity) {
121+
if activity != nil && (filter == nil || filter(activity)) {
120122
ret = append(ret, activity)
121123
next = base64.RawURLEncoding.EncodeToString(k)
122124
}

0 commit comments

Comments
 (0)