Skip to content

Commit

Permalink
update for unit_test block_media
Browse files Browse the repository at this point in the history
  • Loading branch information
rbi-aap committed Sep 3, 2024
1 parent 7204aee commit 49c403f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions newsroom/wire/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def get_picture(item):


def get_body_picture(item):
pictures = [assoc for assoc in item.get('associations', {}).values() if assoc.get('type') == 'picture']
if pictures:
return pictures[0]
pictures = [assoc for assoc in item.get('associations', {}).values()
if assoc is not None and assoc.get('type') == 'picture']
return pictures[0] if pictures else None


def get_caption(picture):
Expand Down

0 comments on commit 49c403f

Please sign in to comment.