From e7e8d1688c4033116d0098261d226f53b9a22195 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 25 Jul 2022 13:12:46 -0400 Subject: [PATCH] Fix trying to connect to cluster whose entity doesn't exist (#5881) * Fix trying to connect to cluster whose entity doesn't exist - If a Cluster is trying to be connected to but there is no associated entity then don't try and connect Signed-off-by: Sebastian Malton * Revert cleanup Signed-off-by: Sebastian Malton --- src/renderer/components/cluster-manager/cluster-view.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/components/cluster-manager/cluster-view.tsx b/src/renderer/components/cluster-manager/cluster-view.tsx index 1eba3195a9..4129817fa0 100644 --- a/src/renderer/components/cluster-manager/cluster-view.tsx +++ b/src/renderer/components/cluster-manager/cluster-view.tsx @@ -68,6 +68,11 @@ class NonInjectedClusterView extends React.Component { bindEvents() { disposeOnUnmount(this, [ reaction(() => this.clusterId, async (clusterId) => { + // TODO: replace with better handling + if (clusterId && !this.props.entityRegistry.getById(clusterId)) { + return this.props.navigateToCatalog(); // redirect to catalog when the clusterId does not correspond to an entity + } + this.props.clusterFrames.setVisibleCluster(clusterId); this.props.clusterFrames.initView(clusterId); requestClusterActivation(clusterId, false); // activate and fetch cluster's state from main