diff --git a/public/pages/Main/Main.tsx b/public/pages/Main/Main.tsx index c2cb4213..95d1ebb3 100644 --- a/public/pages/Main/Main.tsx +++ b/public/pages/Main/Main.tsx @@ -169,12 +169,22 @@ export default class Main extends Component { }; 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) { + // Filter out invalid data source + return false; + } }; getServices(http: HttpSetup) {