From 30f88520c83aa9f38bd968a6fda49e39cf58f38e Mon Sep 17 00:00:00 2001 From: Joxit Date: Sun, 18 Sep 2016 15:06:16 +0200 Subject: [PATCH] [Fix] error when there is no images/tags --- src/tags/catalog.tag | 5 +++-- src/tags/taglist.tag | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tags/catalog.tag b/src/tags/catalog.tag index 6127b52..0f0c86c 100644 --- a/src/tags/catalog.tag +++ b/src/tags/catalog.tag @@ -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(); - + \ No newline at end of file diff --git a/src/tags/taglist.tag b/src/tags/taglist.tag index 690390a..59801cb 100644 --- a/src/tags/taglist.tag +++ b/src/tags/taglist.tag @@ -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 @@ }; - + \ No newline at end of file