From f499ad5771a7a2b98524e992b3cd2fa1668c9747 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 11 Mar 2021 13:09:43 -0600 Subject: [PATCH] UI: Add null check before getting userRootNamespace from storage (#11094) * Add null check before getting userRootNamespace from storage * Add changelog --- changelog/11094.txt | 3 +++ ui/app/routes/vault/cluster.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/11094.txt diff --git a/changelog/11094.txt b/changelog/11094.txt new file mode 100644 index 000000000000..a54b78f0125c --- /dev/null +++ b/changelog/11094.txt @@ -0,0 +1,3 @@ +```changelog:bug +ui: Fix issue where logging in without namespace input causes error +``` diff --git a/ui/app/routes/vault/cluster.js b/ui/app/routes/vault/cluster.js index f489a9d3a2ae..3b9d28f93dc0 100644 --- a/ui/app/routes/vault/cluster.js +++ b/ui/app/routes/vault/cluster.js @@ -42,7 +42,7 @@ export default Route.extend(ModelBoundaryRoute, ClusterRoute, { // use user's root namespace to redirect to properly param'd url if (!namespace && currentTokenName && !Ember.testing) { const storage = getStorage().getItem(currentTokenName); - namespace = storage.userRootNamespace; + namespace = storage?.userRootNamespace; // only redirect if something other than nothing if (namespace) { this.transitionTo({ queryParams: { namespace } });