Skip to content

Commit

Permalink
MAINT: Return 0 for length of broken galleries
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-zon authored Aug 27, 2024
1 parent 034dbf2 commit eff36f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/zeit/content/gallery/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def items(self):
return list(zip(list(self.keys()), list(self.values())))

def __len__(self):
if self._image_folder is None:
return 0
return int(self._entries_container.xpath('count(block)'))

def __setitem__(self, key, value):
Expand Down

0 comments on commit eff36f1

Please sign in to comment.