diff --git a/web_ui/frontend/app/director/components/GeoIpErrorTable.tsx b/web_ui/frontend/app/director/components/GeoIpErrorTable.tsx index ef133090c..ce8240dca 100644 --- a/web_ui/frontend/app/director/components/GeoIpErrorTable.tsx +++ b/web_ui/frontend/app/director/components/GeoIpErrorTable.tsx @@ -51,7 +51,7 @@ const GeoIpErrorTable = () => { await alertOnError(getOverriddenGeoIps, 'Could not get config', dispatch) ); const patchedIps = useMemo(() => { - return config?.GeoIPOverrides === undefined + return config?.GeoIPOverrides == null ? [] : Object.values(config.GeoIPOverrides).map((x: GeoIPOverride) => x.ip); }, [config]); diff --git a/web_ui/frontend/app/director/metrics/components/StorageTable.tsx b/web_ui/frontend/app/director/metrics/components/StorageTable.tsx index 3ac6d47c1..d27850c04 100644 --- a/web_ui/frontend/app/director/metrics/components/StorageTable.tsx +++ b/web_ui/frontend/app/director/metrics/components/StorageTable.tsx @@ -79,11 +79,11 @@ export const StorageTable = () => { {Object.values(storageData) - .sort((a, b) => - a.serverName.toUpperCase() > b.serverName.toUpperCase() - ? 1 - : -1 - ) + .sort((a, b) => { + const nameA = a.serverName.toUpperCase(); + const nameB = b.serverName.toUpperCase(); + return nameA > nameB ? 1 : nameA < nameB ? -1 : 0; + }) .map((d) => ( {d.serverName} @@ -138,6 +138,10 @@ const getStorageData = async ( const serverName = r.metric.server_name; const type = r.metric.type; + if (serverName === undefined) { + return acc; + } + acc[serverName] = { ...acc?.[serverName], serverName: serverName,