misc: protect placeholder against page missing from context (#19511)

This commit is contained in:
Frédéric Péters 2017-10-18 10:16:43 +02:00
parent 69f2d0511f
commit 28e0bd1746
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ def placeholder(context, placeholder_name, **options):
# ajax call
page_cells = context.get('page_cells')
elif not context.get('render_skeleton'):
page_cells = context['page'].get_cells()
page_cells = context['page'].get_cells() if 'page' in context else []
context['cells'] = [x for x in page_cells if
x.placeholder == placeholder_name and
(context.get('render_skeleton') or x.is_relevant(context))]