From 709c3c600b090a51c86c9d00e9eaa8bb05a58466 Mon Sep 17 00:00:00 2001 From: Andrei Pohilko Date: Thu, 16 Feb 2023 12:32:48 +0000 Subject: [PATCH] Fix inability to reconfigure charts without corresponding repository --- pkg/dashboard/static/actions.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/dashboard/static/actions.js b/pkg/dashboard/static/actions.js index 677618e..bafed30 100644 --- a/pkg/dashboard/static/actions.js +++ b/pkg/dashboard/static/actions.js @@ -170,14 +170,13 @@ $('#upgradeModal select').change(function () { const self = $(this) const ver = self.find("option:selected").data("ver"); - let chart = ver.repository + "/" + ver.name; - if (!ver.name) { - chart = "" - } - - // local chart case - if (ver.urls && ver.urls.length && ver.urls[0].startsWith("file://")) { - chart = ver.urls[0]; + let chart = "" + if (ver) { + chart = ver.repository + "/" + ver.name; + // local chart case + if (ver.urls && ver.urls.length && ver.urls[0].startsWith("file://")) { + chart = ver.urls[0]; + } } $('#upgradeModal').data("chart", chart)