From 0491589d50abdd392bffb016d58f9310e45ca701 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 11 Nov 2019 09:42:36 -0500 Subject: [PATCH] [SearchProfiler] Fix console error message when umounting (#50105) * Safer access of input ref * Remove unnecessary "!" [skip ci] --- .../application/containers/profile_query_editor.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/searchprofiler/public/np_ready/application/containers/profile_query_editor.tsx b/x-pack/legacy/plugins/searchprofiler/public/np_ready/application/containers/profile_query_editor.tsx index ea3421ffe89aa..b879f15b72998 100644 --- a/x-pack/legacy/plugins/searchprofiler/public/np_ready/application/containers/profile_query_editor.tsx +++ b/x-pack/legacy/plugins/searchprofiler/public/np_ready/application/containers/profile_query_editor.tsx @@ -86,8 +86,10 @@ export const ProfileQueryEditor = memo(() => { { - indexInputRef.current = ref!; - ref!.value = DEFAULT_INDEX_VALUE; + if (ref) { + indexInputRef.current = ref; + ref.value = DEFAULT_INDEX_VALUE; + } }} />