mirror of
https://github.com/discourse/discourse.git
synced 2025-04-25 22:24:32 +08:00
FIX: dont error when bookmark topic is nil (#10555)
This commit is contained in:
parent
b31da92ede
commit
94152e4640
@ -7,6 +7,7 @@ class BookmarkReminderNotificationHandler
|
|||||||
if bookmark.post.blank? || bookmark.post.deleted_at.present?
|
if bookmark.post.blank? || bookmark.post.deleted_at.present?
|
||||||
return clear_reminder(bookmark)
|
return clear_reminder(bookmark)
|
||||||
end
|
end
|
||||||
|
return unless bookmark.topic
|
||||||
|
|
||||||
create_notification(bookmark)
|
create_notification(bookmark)
|
||||||
|
|
||||||
|
@ -59,4 +59,11 @@ RSpec.describe Jobs::BookmarkReminderNotifications do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'will not send notification when topic is not available' do
|
||||||
|
bookmark1.topic.destroy
|
||||||
|
bookmark2.topic.destroy
|
||||||
|
bookmark3.topic.destroy
|
||||||
|
expect { subject.execute }.not_to change { Notification.where(notification_type: Notification.types[:bookmark_reminder]).count }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user