We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14d74e3 commit 39542c7Copy full SHA for 39542c7
1 file changed
collective/behavior/relatedmedia/browser.py
@@ -336,7 +336,7 @@ def __call__(self):
336
337
source_obj = relation.from_object
338
339
- if filter_keyword and not match:
+ if source_obj and filter_keyword and not match:
340
# check if source or target matches the filter keyword
341
match = (
342
filter_keyword in source_obj.title_or_id().lower()
@@ -351,8 +351,8 @@ def __call__(self):
351
url=obj.absolute_url_path(),
352
),
353
target=dict(
354
- title=source_obj.title_or_id(),
355
- url=source_obj.absolute_url_path(),
+ title=source_obj.title_or_id() if source_obj else "-broken-",
+ url=source_obj.absolute_url_path() if source_obj else "#",
356
357
)
358
0 commit comments