Ver Fonte

Fix endpoints page crash on no provider label

The endpoints page might crash if the provider label is not set. This
can happen depending on the order of the endpoints in the list. This
commit fixes the crash by checking for the label before trying to
render it.
Sergiu Miclea há 2 anos atrás
pai
commit
8e75563fd8
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      src/components/smart/EndpointsPage/EndpointsPage.tsx

+ 2 - 1
src/components/smart/EndpointsPage/EndpointsPage.tsx

@@ -94,7 +94,8 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
     const providers = endpointStore.endpoints.reduce((p, endpoint) => {
       if (!p.find(p2 => p2.value === endpoint.type)) {
         p.push({
-          label: configLoader.config.providerNames[endpoint.type],
+          label:
+            configLoader.config.providerNames[endpoint.type] || endpoint.type,
           value: endpoint.type,
         });
       }