Skip to content

Commit

Permalink
[ogcapi] make sure there are features before accessing them in jinja …
Browse files Browse the repository at this point in the history
…templates (#6588)

Co-authored-by: Landry Breuil <landry@rhaalovely.net>
  • Loading branch information
github-actions[bot] and landryb committed Aug 6, 2022
1 parent 6833ddd commit d4fdbe3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions share/ogcapi/templates/html-bootstrap4/collection-items.html
Expand Up @@ -49,9 +49,11 @@ <h1>{{ template.title }} - Collection Items: {{ response.collection.title }}</h1
<table class="table">
<thead class="thead-light">
<th>ID</th>
{% if response.features %}
{% for key, value in response.features.0.properties %}
<th>{{ key }}</th>
{% endfor %}
{% endif %}
</thead>
<tbody>
{% for feature in response.features %}
Expand Down
2 changes: 2 additions & 0 deletions share/ogcapi/templates/html-plain/collection-items.html
Expand Up @@ -10,9 +10,11 @@ <h1>{{ template.title }} - Collection Items: {{ response.collection.title }}</h1
<table>
<thead>
<th>ID</th>
{% if response.features %}
{% for key, value in response.features.0.properties %}
<th>{{ key }}</th>
{% endfor %}
{% endif %}
</thead>
<tbody>
{% for feature in response.features %}
Expand Down

0 comments on commit d4fdbe3

Please sign in to comment.