Skip to content

Commit

Permalink
FIX: for illegal post ids causing search error
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Jun 12, 2024
1 parent b8e533d commit 254bbaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/discourse_chatbot/functions/forum_search_function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ def find_post_and_topic_ids_from_raw_urls(raw)

post = ::Post.find_by(topic_id: topic_id_in_text.to_i, post_number: post_number_in_text.to_i)

post_ids_found << post.id
topic_ids_found << post.topic_id
if !post.nil?
post_ids_found << post.id
topic_ids_found << post.topic_id
end
end

[topic_ids_found, post_ids_found]
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-chatbot
# about: a plugin that allows you to have a conversation with a configurable chatbot in Discourse Chat, Topics and Private Messages
# version: 0.9.30
# version: 0.9.31
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down

0 comments on commit 254bbaa

Please sign in to comment.