Permalink
Browse files

Fix #3076, fix #3077 — Guard against null items in gallery meta files

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
Kwpolska committed May 8, 2018
1 parent 465f305 commit 0a344255cf04825059c331a5f97f9f525b5482a9
Showing with 3 additions and 2 deletions.
  1. +1 −0 CHANGES.txt
  2. +2 −2 nikola/plugins/task/galleries.py
View
@@ -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)
@@ -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)

0 comments on commit 0a34425

Please sign in to comment.