Skip to content

Commit

Permalink
Update categories/templatetags/category_tags.py
Browse files Browse the repository at this point in the history
Added NoneType check to display_drilldown_as_ul on line 188 to fix NoneType error.
  • Loading branch information
iepathos committed Feb 25, 2013
1 parent 59c3e27 commit fb6fb4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion categories/templatetags/category_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ def display_drilldown_as_ul(category, using='categories.Category'):
</ul>
"""
cat = get_category(category, using)
return {'category': cat, 'path': drilldown_tree_for_node(cat) or []}
if cat is None:
return {'category': cat, 'path': []}
else:
return {'category': cat, 'path': drilldown_tree_for_node(cat)}


@register.inclusion_tag('categories/ul_tree.html')
Expand Down

0 comments on commit fb6fb4e

Please sign in to comment.