Skip to content

Commit

Permalink
Fix #3076, fix #3077 — Guard against null items in gallery meta files
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 8, 2018
1 parent 465f305 commit 0a34425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -9,6 +9,7 @@ Features
Bugfixes
--------

* Guard against null items in gallery meta files (Issues #3076, #3077)
* Respect ``USE_FILENAME_AS_TITLE`` in galleries with a meta file
* Fix gallery metadata for multilingual sites (Issue #3078)

Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/task/galleries.py
Expand Up @@ -466,10 +466,10 @@ def find_metadata(self, gallery, lang):
continue
if 'name' in img:
img_name = img.pop('name')
if 'caption' in img:
if 'caption' in img and img['caption']:
captions[img_name] = img.pop('caption')

if 'order' in img:
if 'order' in img and img['order'] is not None:
order.insert(img.pop('order'), img_name)
else:
order.append(img_name)
Expand Down

0 comments on commit 0a34425

Please sign in to comment.