diff --git a/packages/dashboard-frontend/src/services/registry/devfiles.ts b/packages/dashboard-frontend/src/services/registry/devfiles.ts index 8017f614b..38f052ed7 100644 --- a/packages/dashboard-frontend/src/services/registry/devfiles.ts +++ b/packages/dashboard-frontend/src/services/registry/devfiles.ts @@ -178,10 +178,7 @@ export async function fetchRegistryMetadata( throw new DevfileMetaDataIsNotArrayError(location); } } catch (e) { - if ( - e instanceof DevfileMetaDataIsNotArrayError || - index === registryIndexLocations.length - 1 - ) { + if (index === registryIndexLocations.length - 1) { throw e; } } diff --git a/packages/dashboard-frontend/src/services/registry/fetchData.ts b/packages/dashboard-frontend/src/services/registry/fetchData.ts index fdc81755f..d71f7fd62 100644 --- a/packages/dashboard-frontend/src/services/registry/fetchData.ts +++ b/packages/dashboard-frontend/src/services/registry/fetchData.ts @@ -16,7 +16,7 @@ import axios from 'axios'; export async function fetchData(url: string): Promise { try { const response = await axios.get(url); - return response.data; + return response?.data; } catch (e) { throw new Error(common.helpers.errors.getMessage(e)); }