Skip to content

Commit 4bc1064

Browse files
authored
PluginWikiExtensionsTagSearchable: Skip if no FullTextSearch::Target for the target WikiPage (#150)
This can occur when WikiPage data is imported asynchronously.
1 parent 161b082 commit 4bc1064

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/full_text_search/plugin_wiki_extensions_tag_searchable.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ def find_fts_tag_label_id
2424

2525
def fts_after_create
2626
fts_target = find_fts_target
27+
return unless fts_target
2728
fts_target.tag_ids |= [find_fts_tag_label_id]
2829
fts_target.save!
2930
end
3031

3132
def fts_after_destroy
3233
fts_target = find_fts_target
34+
return unless fts_target
3335
fts_target.tag_ids -= [find_fts_tag_label_id]
3436
fts_target.save!
3537
end

0 commit comments

Comments
 (0)