Skip to content

Commit

Permalink
Don't try to access first element of collection when list is empty (f…
Browse files Browse the repository at this point in the history
…ixes #76)
  • Loading branch information
Jeff Knupp committed Apr 28, 2014
1 parent 69613c5 commit f01ad82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sandman/templates/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% block content %}

<div class="col-md-8">
{% if resources %}
<h2>{{ resources[0].__tablename__ }}</h2>
<table class="table table-condensed table-striped">
<thead>
Expand All @@ -25,4 +26,7 @@ <h2>{{ resources[0].__tablename__ }}</h2>
{% endfor %}
{% endfor %}
</table>
{% else %}
<h2>Empty collection</h2>
{% endif %}
{% endblock content%}

0 comments on commit f01ad82

Please sign in to comment.