mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: prevents trigger post read count update on non existing post (#8128)
This commit is contained in:
parent
e5af03be01
commit
3ee6e859ec
1 changed files with 1 additions and 0 deletions
|
@ -390,6 +390,7 @@ SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.trigger_post_read_count_update(post, groups, last_read_post_number, user_id)
|
def self.trigger_post_read_count_update(post, groups, last_read_post_number, user_id)
|
||||||
|
return if !post
|
||||||
return if groups.empty?
|
return if groups.empty?
|
||||||
opts = { readers_count: post.readers_count, reader_id: user_id }
|
opts = { readers_count: post.readers_count, reader_id: user_id }
|
||||||
post.publish_change_to_clients!(:read, opts)
|
post.publish_change_to_clients!(:read, opts)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue