diff --git a/public/utils/helpers.js b/public/utils/helpers.js index f95f3b6fc..91d748666 100644 --- a/public/utils/helpers.js +++ b/public/utils/helpers.js @@ -172,12 +172,18 @@ export function getManageChannelsUrl() { } export function dataSourceFilterFn(dataSource) { - const dataSourceVersion = dataSource?.attributes?.dataSourceVersion || ''; - const installedPlugins = dataSource?.attributes?.installedPlugins || []; - return ( - semver.satisfies(dataSourceVersion, pluginManifest.supportedOSDataSourceVersions) && - pluginManifest.requiredOSDataSourcePlugins.every((plugin) => installedPlugins.includes(plugin)) - ); + try { + const dataSourceVersion = dataSource?.attributes?.dataSourceVersion || ''; + const installedPlugins = dataSource?.attributes?.installedPlugins || []; + return ( + pluginManifest.requiredOSDataSourcePlugins.every((plugin) => + installedPlugins.includes(plugin) + ) && semver.satisfies(dataSourceVersion, pluginManifest.supportedOSDataSourceVersions) + ); + } catch (error) { + // Filter out invalid data source + return false; + } } export function getSeverityText(severity) {