From 2ae566ec78d0c0ed97552a41961d3e877eed180c Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Thu, 2 Apr 2020 13:04:32 -0700 Subject: [PATCH] [Ingest] Fix package info request returning 500 (#61712) * Fix 500 package info request error * Fix installed packages page not loading Co-authored-by: Elastic Machine --- .../applications/ingest_manager/components/package_icon.tsx | 2 +- .../ingest_manager/sections/epm/hooks/use_local_search.tsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/package_icon.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/package_icon.tsx index c5a0e600b7d50..8ba597a0d377e 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/package_icon.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/package_icon.tsx @@ -59,7 +59,7 @@ const usePackageIcon = (packageName: string, version?: string, icons?: Package[' } // Use API to see if package has icons defined - if (!icons && version !== undefined) { + if (!icons && version) { fromPackageInfo(pkgKey) .catch(() => undefined) // ignore API errors .then(fromInput); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx index 26f1ef6a80271..c81dc15f569fa 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/hooks/use_local_search.tsx @@ -15,8 +15,6 @@ export function useLocalSearch(packageList: PackageList) { const localSearchRef = useRef(null); useEffect(() => { - if (!packageList.length) return; - const localSearch = new LocalSearch(searchIdField); fieldsToSearch.forEach(field => localSearch.addIndex(field)); localSearch.addDocuments(packageList);