From 37785f78726c66623558d5e9b2cf0c8a44367ef7 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 11 Nov 2019 12:03:51 -0500 Subject: [PATCH] [SearchProfiler] Fix console error message when umounting (#50105) (#50157) * 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 ea3421ffe89aa8..b879f15b729982 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; + } }} />