From feed1df8cac190c28d12a9a9acb16e32cd87730a Mon Sep 17 00:00:00 2001 From: jsers Date: Thu, 19 Mar 2020 11:31:59 +0800 Subject: [PATCH] fix: failed to load the bind node --- web/src/components/EndpointList/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/components/EndpointList/index.tsx b/web/src/components/EndpointList/index.tsx index b824de15..788b0e2b 100644 --- a/web/src/components/EndpointList/index.tsx +++ b/web/src/components/EndpointList/index.tsx @@ -76,7 +76,10 @@ class index extends Component { processData = async (endpoints: Endpoint[]) => { if (this.state.displayBindNode && endpoints) { const idents = _.map(endpoints, item => item.ident); - const endpointNodes = await request(`${api.endpoint}s/bindings?idents=${_.join(idents, ',')}`); + let endpointNodes: any[] = []; + if (idents.length) { + endpointNodes = await request(`${api.endpoint}s/bindings?idents=${_.join(idents, ',')}`); + } const newEndpoints = _.map(endpoints, (item) => { const current = _.find(endpointNodes, { ident: item.ident }); const nodes = _.get(current, 'nodes', []);