Skip to content

Commit

Permalink
UI: Add null check before getting userRootNamespace from storage (#11094
Browse files Browse the repository at this point in the history
)

* Add null check before getting userRootNamespace from storage

* Add changelog
  • Loading branch information
chelshaw committed Mar 11, 2021
1 parent 794000c commit de45ff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/11094.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```changelog:bug
ui: Fix issue where logging in without namespace input causes error
```
2 changes: 1 addition & 1 deletion ui/app/routes/vault/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } });
Expand Down

0 comments on commit de45ff6

Please sign in to comment.