Commit 77150ff6 authored by Romain Courteaud's avatar Romain Courteaud Committed by Jérome Perrin

Do not fail if no result is available.

parent 458eef37
......@@ -10,9 +10,11 @@
<script id="table-template" type="text/x-handlebars-template">
<ul data-role="listview" data-inset="true" class="document-listview">
{{#documentlist}}
{{#each documentlist}}
<li><a href="{{link}}">{{title}}</a></li>
{{/documentlist}}
{{else}}
<p>No result yet.</p>
{{/each}}
</ul>
</script>
......
......@@ -33,6 +33,13 @@
return gadget.aq_getAttachment({
"_id": gadget.props.jio_key,
"_attachment": "simulation.json"
})
.push(undefined, function (error) {
if (error.status === 404) {
// Simulation not yet generated
return JSON.stringify([]);
}
throw error;
})
.push(function (sim_json) {
var document_list = JSON.parse(sim_json),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment