mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: don't log user action if no user exists for topic
This commit is contained in:
parent
b1d6e2307f
commit
ad2a3ec5bc
1 changed files with 5 additions and 0 deletions
|
@ -79,6 +79,11 @@ class UserActionObserver < ActiveRecord::Observer
|
|||
end
|
||||
|
||||
def log_topic(model)
|
||||
|
||||
# no action to log here, this can happen if a user is deleted
|
||||
# then topic has no user_id
|
||||
return unless model.user_id
|
||||
|
||||
row = {
|
||||
action_type: model.archetype == Archetype.private_message ? UserAction::NEW_PRIVATE_MESSAGE : UserAction::NEW_TOPIC,
|
||||
user_id: model.user_id,
|
||||
|
|
Loading…
Reference in a new issue