From f826381681e9a7f737025e5db8f64e49a010fd1c Mon Sep 17 00:00:00 2001 From: Joxit Date: Sun, 3 Apr 2022 00:02:15 +0200 Subject: [PATCH] fix(custom-labels): history fails on images with no labels --- src/components/tag-history/tag-history.riot | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/tag-history/tag-history.riot b/src/components/tag-history/tag-history.riot index 1fc659f..32e76d9 100644 --- a/src/components/tag-history/tag-history.riot +++ b/src/components/tag-history/tag-history.riot @@ -180,7 +180,6 @@ along with this program. If not, see . }; const getConfig = function (blobs, { historyCustomLabels }) { - console.log(this); const res = [ 'architecture', 'User', @@ -212,12 +211,14 @@ along with this program. If not, see . delete res.Labels.maintainer; } - historyCustomLabels - .filter((label) => res.Labels[label]) - .forEach((label) => { - res[`custom-label-${label}`] = res.Labels[label]; - delete res.Labels[label]; - }); + if (res.Labels) { + historyCustomLabels + .filter((label) => res.Labels[label]) + .forEach((label) => { + res[`custom-label-${label}`] = res.Labels[label]; + delete res.Labels[label]; + }); + } return res; };