[Fix] error when there is no images/tags

This commit is contained in:
Joxit
2016-09-18 15:06:16 +02:00
parent c46129f9d0
commit 30f88520c8
2 changed files with 6 additions and 4 deletions

View File

@@ -57,7 +57,8 @@
};
oReq.addEventListener('load', function () {
if (this.status == 200) {
registryUI.catalog.repositories = JSON.parse(this.responseText).repositories.sort();
registryUI.catalog.repositories = JSON.parse(this.responseText).repositories || [];
registryUI.catalog.repositories.sort();
} else if (this.status == 404) {
registryUI.catalog.createSnackbar('Server not found');
} else {
@@ -86,4 +87,4 @@
registryUI.catalog.display();
</script>
<!-- End of tag -->
</catalog>
</catalog>

View File

@@ -71,7 +71,8 @@
};
oReq.addEventListener('load', function () {
if (this.status == 200) {
registryUI.taglist.tags = JSON.parse(this.responseText).tags.sort();
registryUI.taglist.tags = JSON.parse(this.responseText).tags || [];
registryUI.taglist.tags.sort();
} else if (this.status == 404) {
registryUI.taglist.createSnackbar('Server not found');
} else {
@@ -111,4 +112,4 @@
};
</script>
<!-- End of tag -->
</taglist>
</taglist>