Skip to content

Commit e034d62

Browse files
committed
fix
1 parent 1908109 commit e034d62

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/models/event.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ class Event < ApplicationRecord
5050
self.topic = tags.find { |tag| tag[0] == "t" }&.[](1)
5151
self.recipient = tags.find { |tag| tag[0] == "p" }&.[](1)
5252

53-
self.conversation ||= Conversation.find_or_create_by(pubkey: pubkey, session: session) do |c|
54-
c.latest_event_created_at = created_at
55-
c.events_count = 0
53+
if session
54+
self.conversation ||= Conversation.find_or_create_by(pubkey: pubkey, session: session) do |c|
55+
c.latest_event_created_at = created_at
56+
c.events_count = 0
57+
end
5658
end
5759
end
5860

0 commit comments

Comments
 (0)