diff --git a/public/utils/helpers.tsx b/public/utils/helpers.tsx index 378db069..14527df3 100644 --- a/public/utils/helpers.tsx +++ b/public/utils/helpers.tsx @@ -654,12 +654,18 @@ export function setBreadcrumbs(crumbs: ChromeBreadcrumb[]) { } export function dataSourceFilterFn(dataSource: SavedObject) { - 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: any) { + // Filter out invalid data source + return false; + } } export function getSeverityText(severity: string) {