File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ def get_text_from_text_object(
169169# Fallback: attachment[].fallback
170170def add_message_searchable_content (message : dict [str , Any ]) -> None :
171171 searchable_content = message .get ("text" , "" )
172+ if searchable_content is None :
173+ searchable_content = ""
172174 try :
173175 # convert list of dicts into actual slack_sdk attachment objects
174176 attachments = list (map (get_attachment , message .get ("attachments" , []) or []))
@@ -202,15 +204,13 @@ def add_message_searchable_content(message: dict[str, Any]) -> None:
202204 searchable_content += (
203205 f"\n { get_text_from_text_object (block .text )} "
204206 )
205- for raw_field in block .fields :
207+ for field in block .fields :
206208 if (
207- not isinstance (raw_field , TextObject )
208- and raw_field ["value" ]
209- and raw_field ["title" ]
209+ not isinstance (field , TextObject )
210+ and field ["value" ]
211+ and field ["title" ]
210212 ):
211- field = safely_instantiate_class (
212- raw_field , AttachmentField
213- )
213+ field = safely_instantiate_class (field , AttachmentField )
214214 searchable_content += (
215215 f"\n { get_text_from_text_object (field )} "
216216 )
You can’t perform that action at this time.
0 commit comments